Skip to content

Commit 51f9cb0

Browse files
authored
Merge pull request #220 from conveyal/dev
3.11.0
2 parents da1c618 + 37fadec commit 51f9cb0

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

__tests__/lib/__snapshots__/jest.js.snap

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`test.js generateTestConfig should generate proper config 1`] = `
3+
exports[`jest.js generateTestConfig should generate proper config 1`] = `
44
Array [
5-
"--forceExit",
65
"--updateSnapshot",
76
"--no-cache",
87
"--runInBand",
98
"--config",
109
Object {
11-
"cacheDirectory": "tmp",
1210
"collectCoverageFrom": Array [
1311
"lib/**/*.js",
1412
"bin",

__tests__/lib/jest.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

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

5-
const JEST_CONFIG_INDEX = 5
5+
const JEST_CONFIG_INDEX = 4
66

7-
describe('test.js', () => {
7+
describe('jest.js', () => {
88
it('generateTestConfig should generate proper config', () => {
99
const cfg = jestUtils.generateTestConfig(['these', 'files', 'only'], {
1010
cache: false,

bin/mastarm-test

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ commander
2525
'--coverage-paths <paths>',
2626
'Extra paths to collect code coverage from'
2727
)
28+
.option('--force-exit', 'Force Jest to exit after all tests have completed running.')
2829
.option('--no-cache', 'Run Jest without cache (defaults to using cache)')
2930
.option('--run-in-band', 'Run all tests serially in the current process')
3031
.option('--setup-files <paths>', 'Setup files to run before each test')

lib/jest.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const pkg = require('./pkg')
44
module.exports.generateTestConfig = (patterns, options) => {
55
// jest config params
66
const jestConfig = {
7-
cacheDirectory: 'tmp',
87
collectCoverage: options.coverage,
98
collectCoverageFrom: ['lib/**/*.js'],
109
coverageDirectory: 'coverage',
@@ -42,7 +41,12 @@ module.exports.generateTestConfig = (patterns, options) => {
4241
}
4342

4443
// jest cli params
45-
let jestArguments = ['--forceExit']
44+
let jestArguments = []
45+
46+
if (options.forceExit) {
47+
jestArguments.push('--forceExit')
48+
}
49+
4650
if (options.updateSnapshots) {
4751
jestArguments.push('--updateSnapshot')
4852
}

0 commit comments

Comments
 (0)