Skip to content

Commit

Permalink
include mocha fixes to run babel+JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
jdan committed Jul 23, 2015
1 parent 7b64252 commit f3ae011
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"prod": "webpack -p",
"dev": "webpack -d --devtool hidden --output-file=tota11y.js",
"lint": "eslint index.js plugins test",
"test": "mocha --compilers js:babel/register test/*.js",
"test": "mocha --require test/babel-hook test/*.js",
"live-test": "webpack-dev-server --hot --inline"
},
"license": "MIT"
Expand Down
14 changes: 14 additions & 0 deletions test/babel-hook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* A mocha hook that will run before each test.
*
* This sets up babel with options, and stores our JSX transpile target.
*/

// Register all future "require"s with babel
require("babel/register")({
// Let babel know to transpile JSX into E(...)
jsxPragma: "E",
});

// Store our custom JSX transpile target as a global
E = require("../element.js");

0 comments on commit f3ae011

Please sign in to comment.