File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 34
34
"prod" : " webpack -p" ,
35
35
"dev" : " webpack -d --devtool hidden --output-file=tota11y.js" ,
36
36
"lint" : " eslint index.js plugins test" ,
37
- "test" : " mocha --compilers js:babel/register test/*.js" ,
37
+ "test" : " mocha --require test/babel-hook test/*.js" ,
38
38
"live-test" : " webpack-dev-server --hot --inline"
39
39
},
40
40
"license" : " MIT"
Original file line number Diff line number Diff line change
1
+ /**
2
+ * A mocha hook that will run before each test.
3
+ *
4
+ * This sets up babel with options, and stores our JSX transpile target.
5
+ */
6
+
7
+ // Register all future "require"s with babel
8
+ require ( "babel/register" ) ( {
9
+ // Let babel know to transpile JSX into E(...)
10
+ jsxPragma : "E" ,
11
+ } ) ;
12
+
13
+ // Store our custom JSX transpile target as a global
14
+ E = require ( "../element.js" ) ;
You can’t perform that action at this time.
0 commit comments