Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor setting config from argv #3424

Merged
merged 18 commits into from
May 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ exports[`jest --showConfig outputs config info and exits 1`] = `
"mapCoverage": false,
"noStackTrace": false,
"notify": false,
"projects": [
"/mocked/root/path/jest/integration_tests/verbose_reporter"
],
"rootDir": "/mocked/root/path/jest/integration_tests/verbose_reporter",
"testPathPattern": "",
"testResultsProcessor": null,
Expand Down
10 changes: 10 additions & 0 deletions integration_tests/__tests__/config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ test('works with sane config JSON', () => {
});

test('watchman config option is respected over default argv', () => {
const {stdout} = runJest('verbose_reporter', [
'--env=node',
'--watchman=false',
'--debug',
]);

expect(stdout).toMatch('"watchman": false');
});

test('config from argv is respected with sane config JSON', () => {
const {stdout} = runJest('verbose_reporter', [
'--config=' +
JSON.stringify({
Expand Down
4 changes: 3 additions & 1 deletion integration_tests/__tests__/coverage_report-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ test('outputs coverage report as json', () => {
try {
JSON.parse(stdout);
} catch (err) {
throw new Error("Can't parse the JSON result from stdout" + err.toString());
throw new Error(
"Can't parse the JSON result from stdout. " + err.toString(),
);
}
});
4 changes: 1 addition & 3 deletions integration_tests/runJest.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ function runJest(dir, args) {
);
}

const result = spawnSync(JEST_PATH, args || [], {
cwd: dir,
});
const result = spawnSync(JEST_PATH, args || [], {cwd: dir});

result.stdout = result.stdout && result.stdout.toString();
result.stderr = result.stderr && result.stderr.toString();
Expand Down
Loading