Skip to content

Instantly share code, notes, and snippets.

@tomatau
Created March 5, 2015 13:58
Show Gist options
  • Save tomatau/38ef416fbca4c9f31d8f to your computer and use it in GitHub Desktop.
Save tomatau/38ef416fbca4c9f31d8f to your computer and use it in GitHub Desktop.
Object.getPrototypeOf === undefined
/** Jest Config **/
"jest": {
"globals": {
"__DEV__": true,
"__TEST__": true
},
"testDirectoryName": "app/tests",
"testFileExtensions": [
"es6"
],
"setupTestFrameworkScriptFile": "jest/setup.js",
"modulePathIgnorePatterns": [
"app/dist",
"bin",
"webpack"
],
"moduleFileExtensions": [
"js",
"jsx",
"es6"
],
"scriptPreprocessor": "jest/script-preprocessor.js",
"unmockedModulePathPatterns": [
"path",
"events",
"node_modules/wizenoze-core/flux",
"node_modules/react",
"node_modules/react-bootstrap",
"node_modules/mcfly",
"node_modules/counterpart",
"node_modules/lodash",
"node_modules/keymirror",
"node_modules/es6-promise",
"node_modules/jasmine-spec-reporter"
]
}
/** script-preprocessor.js */
var ReactTools = require('react-tools');
var to5 = require("babel-core");
module.exports = {
process: function(src, path) {
[
/react-fa/,
/\.jsx$/
].forEach(function(regex){
if( path.match(regex) ) src = '';
});
if (src !== '' && path.match(/\.es6$/)) {
src = to5.transform(src, {
filename: path,
experimental: true,
optional: ['runtime'],
ignore: false
}).code;
}
return src
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment