Skip to content

Commit d78dd73

Browse files
committed
Fix test runner breaking
The test runner script tried to pass the Jest config as stringified JSON, but that was breaking for me somehow. Sidestepped the problem by writing the settings to disk instead and pointing Jest to that file.
1 parent 37e2ce7 commit d78dd73

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ test/**/lcov.info
1010
test/**/lcov-report
1111
test/react/*/test/**/*.spec.js
1212
test/react/**/src
13+
test/jest-config.json
1314
lcov.info
1415

1516
lib/core/metadata.js

test/run-tests.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const npmRun = require('npm-run')
2+
const fs = require('fs')
3+
const path = require('path')
24
const LATEST_VERSION = '16.6'
35
const version = process.env.REACT || LATEST_VERSION
46

@@ -27,7 +29,13 @@ if (version.toLowerCase() === 'all') {
2729
}
2830
}
2931

32+
const configFilePath = path.join(__dirname, 'jest-config.json')
33+
34+
fs.writeFileSync(configFilePath, JSON.stringify(jestConfig))
35+
36+
const commandLine = `jest -c "${configFilePath}" ${process.argv.slice(2).join(' ')}`
37+
3038
npmRun.execSync(
31-
`jest -c '${JSON.stringify(jestConfig)}' ${process.argv.slice(2).join(' ')}`,
39+
commandLine,
3240
{ stdio: 'inherit' }
3341
)

0 commit comments

Comments
 (0)