-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jest does not have proper support for setups that use both a .babelrc and .babelrc.js file as it throws babel errors when you have both. The fix must be made in babel-jest, until then we can use a fork so that atleast jest will function
- Loading branch information
1 parent
b6133e5
commit 3cfd956
Showing
3 changed files
with
30 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
// this file will be used by default by babel@7 once it is released | ||
module.exports = { | ||
"plugins": [ | ||
"transform-decorators-legacy", | ||
"transform-class-properties" | ||
], | ||
"presets": [ | ||
[ | ||
"env", { | ||
"targets": process.env.BABEL_TARGET === 'node' ? { | ||
"node": process.env.IN_PROTRACTOR ? '6' : 'current' | ||
} : { | ||
"browsers": [ | ||
"last 2 versions", | ||
"not ie <= 11" | ||
], | ||
"uglify": process.env.NODE_ENV === 'production', | ||
}, | ||
"loose": true, | ||
"modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false, | ||
"useBuiltIns": true | ||
} | ||
module.exports = () => { | ||
return { | ||
"plugins": [ | ||
"transform-decorators-legacy", | ||
"transform-class-properties" | ||
], | ||
"presets": [ | ||
[ | ||
"env", { | ||
"targets": process.env.BABEL_TARGET === 'node' ? { | ||
"node": process.env.IN_PROTRACTOR ? '6' : 'current' | ||
} : { | ||
"browsers": [ | ||
"last 2 versions", | ||
"not ie <= 11" | ||
], | ||
"uglify": process.env.NODE_ENV === 'production', | ||
}, | ||
"loose": true, | ||
"modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false, | ||
"useBuiltIns": true | ||
} | ||
] | ||
] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import jest from 'jest-cli'; | ||
import gutil from 'gulp-util'; | ||
import through2 from 'through2'; | ||
import path from 'path'; | ||
import packageJson from '../../package.json'; | ||
import {CLIOptions} from 'aurelia-cli'; | ||
|
||
export default (cb) => { | ||
let options = packageJson.jest; | ||
|
||
if (CLIOptions.hasFlag('watch')) { | ||
Object.assign(options, { watch: true}); | ||
} | ||
|
||
process.env.BABEL_TARGET = 'node'; | ||
|
||
jest.runCLI(options, [path.resolve(__dirname, '../../')], (result) => { | ||
if(result.numFailedTests || result.numFailedTestSuites) { | ||
if (result.numFailedTests || result.numFailedTestSuites) { | ||
cb(new gutil.PluginError('gulp-jest', { message: 'Tests Failed' })); | ||
} else { | ||
cb(); | ||
} | ||
}); | ||
}; | ||
}; |