Skip to content

Commit

Permalink
Merge pull request #220 from conveyal/dev
Browse files Browse the repository at this point in the history
3.11.0
  • Loading branch information
evansiroky authored Jun 12, 2017
2 parents da1c618 + 37fadec commit 51f9cb0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 1 addition & 3 deletions __tests__/lib/__snapshots__/jest.js.snap
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`test.js generateTestConfig should generate proper config 1`] = `
exports[`jest.js generateTestConfig should generate proper config 1`] = `
Array [
"--forceExit",
"--updateSnapshot",
"--no-cache",
"--runInBand",
"--config",
Object {
"cacheDirectory": "tmp",
"collectCoverageFrom": Array [
"lib/**/*.js",
"bin",
Expand Down
4 changes: 2 additions & 2 deletions __tests__/lib/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

const jestUtils = require('../../lib/jest')

const JEST_CONFIG_INDEX = 5
const JEST_CONFIG_INDEX = 4

describe('test.js', () => {
describe('jest.js', () => {
it('generateTestConfig should generate proper config', () => {
const cfg = jestUtils.generateTestConfig(['these', 'files', 'only'], {
cache: false,
Expand Down
1 change: 1 addition & 0 deletions bin/mastarm-test
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ commander
'--coverage-paths <paths>',
'Extra paths to collect code coverage from'
)
.option('--force-exit', 'Force Jest to exit after all tests have completed running.')
.option('--no-cache', 'Run Jest without cache (defaults to using cache)')
.option('--run-in-band', 'Run all tests serially in the current process')
.option('--setup-files <paths>', 'Setup files to run before each test')
Expand Down
8 changes: 6 additions & 2 deletions lib/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const pkg = require('./pkg')
module.exports.generateTestConfig = (patterns, options) => {
// jest config params
const jestConfig = {
cacheDirectory: 'tmp',
collectCoverage: options.coverage,
collectCoverageFrom: ['lib/**/*.js'],
coverageDirectory: 'coverage',
Expand Down Expand Up @@ -42,7 +41,12 @@ module.exports.generateTestConfig = (patterns, options) => {
}

// jest cli params
let jestArguments = ['--forceExit']
let jestArguments = []

if (options.forceExit) {
jestArguments.push('--forceExit')
}

if (options.updateSnapshots) {
jestArguments.push('--updateSnapshot')
}
Expand Down

0 comments on commit 51f9cb0

Please sign in to comment.