Skip to content

Commit

Permalink
feat(jest): allow jest options specified in package.json.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwigway committed Jun 2, 2017
1 parent 02f30b7 commit da3f2dc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/jest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path')
const pkg = require('./pkg')

module.exports.generateTestConfig = (patterns, options) => {
// jest config params
Expand Down Expand Up @@ -33,6 +34,13 @@ module.exports.generateTestConfig = (patterns, options) => {
}
})

// add local package.json-level config options
if (pkg.jest != null) {
Object.keys(pkg.jest).forEach(key => {
jestConfig[key] = pkg.jest[key]
})
}

// jest cli params
let jestArguments = ['--forceExit']
if (options.updateSnapshots) {
Expand Down

0 comments on commit da3f2dc

Please sign in to comment.