Skip to content

Commit

Permalink
Merge pull request #44 from JaxGit/babel-core
Browse files Browse the repository at this point in the history
Fix component tests with JSX using babel-core preprocessor instead of…
  • Loading branch information
bartonhammond committed Jan 22, 2016
2 parents 8acab86 + 312dc0e commit 3fb493b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions jestSupport/scriptPreprocess.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

var babel = require('babel-core');

module.exports = {
process: function (src, filename) {
var result = babel.transform(src, {
filename: filename
});

return result.code;
}
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.9b",
"private": true,
"jest": {
"scriptPreprocessor": "./node_modules/babel-jest",
"scriptPreprocessor": "jestSupport/scriptPreprocess.js",
"setupEnvScriptFile": "./node_modules/react-native/jestSupport/env.js",
"testPathIgnorePatterns": [
"/node_modules/"
Expand All @@ -18,6 +18,8 @@
"es6"
],
"unmockedModulePathPatterns": [
"react",
"react-addons-test-utils",
"promise",
"source-map",
"key-mirror",
Expand Down Expand Up @@ -58,6 +60,7 @@
"validate.js": "^0.9.0"
},
"devDependencies": {
"babel-core": "^6.4.5",
"babel-jest": "^6.0.1",
"docker": "^0.2.14",
"istanbul": "gotwarlost/istanbul#source-map",
Expand Down

0 comments on commit 3fb493b

Please sign in to comment.