Skip to content

Commit b8fb285

Browse files
Merge pull request #855 from Availity/fix/workflow-test-args
fix: av test properly passes args to jest
2 parents c661bef + 29c8ec8 commit b8fb285

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/workflow/jest.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function create(settings) {
4343
],
4444
testEnvironment: 'jsdom',
4545
testEnvironmentOptions: {
46-
url: 'http://localhost',
46+
url: 'http://localhost'
4747
},
4848
transform: {
4949
// Jest and Babel don't allow functions in the options so we just return their values here
@@ -94,7 +94,9 @@ function create(settings) {
9494
}
9595

9696
function unit(settings) {
97-
const argv = process.argv.slice(2);
97+
// slice(3) to skip ['node', 'index.js', 'test'] — the yargs command name
98+
// must not be forwarded to Jest as it becomes a test path pattern
99+
const argv = process.argv.slice(3);
98100
const jestConfig = JSON.stringify(create(settings));
99101
argv.push(`--config=${jestConfig}`, '--env=jsdom');
100102

0 commit comments

Comments
 (0)