Skip to content

Commit

Permalink
Keep ARGV only in CLI files
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronabramov committed Jul 12, 2017
1 parent dd6c5c4 commit 6e56c6e
Show file tree
Hide file tree
Showing 30 changed files with 446 additions and 483 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ Object {
"christoph": "pojer",
"dmitrii": "abramov",
"hello": "world",
"pattern": Object {
"input": "add_fail.test.js",
"paths": Array [
"add_fail.test.js",
],
"shouldTreatInputAsPattern": false,
"testPathPattern": "add_fail.test.js",
},
"testPathPattern": "\\"add_fail.test.js\\"",
},
}
`;
Expand Down Expand Up @@ -69,15 +60,6 @@ Object {
"christoph": "pojer",
"dmitrii": "abramov",
"hello": "world",
"pattern": Object {
"input": "add.test.js",
"paths": Array [
"add.test.js",
],
"shouldTreatInputAsPattern": false,
"testPathPattern": "add.test.js",
},
"testPathPattern": "\\"add.test.js\\"",
},
}
`;
Expand All @@ -95,7 +77,7 @@ exports[`Custom Reporters Integration default reporters enabled 2`] = `
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching \\"add.test.js\\".
Ran all test suites matching /add.test.js/i.
"
`;
Expand All @@ -119,17 +101,7 @@ Object {
"called": true,
"path": false,
},
"options": Object {
"pattern": Object {
"input": "add.test.js",
"paths": Array [
"add.test.js",
],
"shouldTreatInputAsPattern": false,
"testPathPattern": "add.test.js",
},
"testPathPattern": "\\"add.test.js\\"",
},
"options": Object {},
}
`;
Expand All @@ -151,3 +123,29 @@ exports[`Custom Reporters Integration invalid format for adding reporters 1`] =
"
`;
exports[`Custom Reporters Integration valid array format for adding reporters 1`] = `
"{
\\"onRunComplete\\": {
\\"called\\": true,
\\"numPassedTests\\": 1,
\\"numFailedTests\\": 0,
\\"numTotalTests\\": 1
},
\\"onRunStart\\": {
\\"called\\": true,
\\"options\\": \\"object\\"
},
\\"onTestResult\\": {
\\"times\\": 1,
\\"called\\": true
},
\\"onTestStart\\": {
\\"called\\": true,
\\"path\\": false
},
\\"options\\": {
\\"Dmitrii Abramov\\": \\"Awesome\\"
}
}"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ exports[`jest --showConfig outputs config info and exits 1`] = `
"clover"
],
"expand": false,
"listTests": false,
"mapCoverage": false,
"maxWorkers": "[maxWorkers]",
"noStackTrace": false,
"nonFlagArgs": [],
"notify": false,
"rootDir": "/mocked/root/path/jest/integration_tests/verbose_reporter",
"testPathPattern": "",
Expand Down
14 changes: 7 additions & 7 deletions integration_tests/__tests__/__snapshots__/snapshot.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ exports[`Snapshot works with escaped characters 1`] = `
Tests: 1 passed, 1 total
Snapshots: 1 added, 1 total
Time: <<REPLACED>>
Ran all test suites matching \\"snapshot.test.js\\".
Ran all test suites matching /snapshot.test.js/i.
"
`;
Expand All @@ -104,7 +104,7 @@ exports[`Snapshot works with escaped characters 2`] = `
Tests: 2 passed, 2 total
Snapshots: 1 added, 1 passed, 2 total
Time: <<REPLACED>>
Ran all test suites matching \\"snapshot.test.js\\".
Ran all test suites matching /snapshot.test.js/i.
"
`;
Expand All @@ -113,7 +113,7 @@ exports[`Snapshot works with escaped characters 3`] = `
Tests: 2 passed, 2 total
Snapshots: 2 passed, 2 total
Time: <<REPLACED>>
Ran all test suites matching \\"snapshot.test.js\\".
Ran all test suites matching /snapshot.test.js/i.
"
`;
Expand All @@ -122,7 +122,7 @@ exports[`Snapshot works with escaped regex 1`] = `
Tests: 2 passed, 2 total
Snapshots: 2 added, 2 total
Time: <<REPLACED>>
Ran all test suites matching \\"snapshot_escape_regex.js\\".
Ran all test suites matching /snapshot_escape_regex.js/i.
"
`;
Expand All @@ -131,7 +131,7 @@ exports[`Snapshot works with escaped regex 2`] = `
Tests: 2 passed, 2 total
Snapshots: 2 passed, 2 total
Time: <<REPLACED>>
Ran all test suites matching \\"snapshot_escape_regex.js\\".
Ran all test suites matching /snapshot_escape_regex.js/i.
"
`;
Expand All @@ -140,7 +140,7 @@ exports[`Snapshot works with template literal subsitutions 1`] = `
Tests: 1 passed, 1 total
Snapshots: 1 added, 1 total
Time: <<REPLACED>>
Ran all test suites matching \\"snapshot_escape_substitution.test.js\\".
Ran all test suites matching /snapshot_escape_substitution.test.js/i.
"
`;
Expand All @@ -149,6 +149,6 @@ exports[`Snapshot works with template literal subsitutions 2`] = `
Tests: 1 passed, 1 total
Snapshots: 1 passed, 1 total
Time: <<REPLACED>>
Ran all test suites matching \\"snapshot_escape_substitution.test.js\\".
Ran all test suites matching /snapshot_escape_substitution.test.js/i.
"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`Stack Trace does not print a stack trace for errors when --noStackTrace
Tests: 3 failed, 3 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching \\"test_error.test.js\\".
Ran all test suites matching /test_error.test.js/i.
"
`;
Expand All @@ -14,7 +14,7 @@ exports[`Stack Trace does not print a stack trace for matching errors when --noS
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching \\"stack_trace.test.js\\".
Ran all test suites matching /stack_trace.test.js/i.
"
`;
Expand All @@ -23,7 +23,7 @@ exports[`Stack Trace does not print a stack trace for runtime errors when --noSt
Tests: 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching \\"runtime_error.test.js\\".
Ran all test suites matching /runtime_error.test.js/i.
"
`;
Expand All @@ -32,7 +32,7 @@ exports[`Stack Trace prints a stack trace for errors 1`] = `
Tests: 3 failed, 3 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching \\"test_error.test.js\\".
Ran all test suites matching /test_error.test.js/i.
"
`;
Expand All @@ -41,7 +41,7 @@ exports[`Stack Trace prints a stack trace for errors without message in stack tr
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching \\"stack_trace_without_message.test.js\\".
Ran all test suites matching /stack_trace_without_message.test.js/i.
"
`;
Expand All @@ -50,7 +50,7 @@ exports[`Stack Trace prints a stack trace for matching errors 1`] = `
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching \\"stack_trace.test.js\\".
Ran all test suites matching /stack_trace.test.js/i.
"
`;
Expand All @@ -59,6 +59,6 @@ exports[`Stack Trace prints a stack trace for runtime errors 1`] = `
Tests: 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching \\"runtime_error.test.js\\".
Ran all test suites matching /runtime_error.test.js/i.
"
`;
3 changes: 2 additions & 1 deletion integration_tests/__tests__/custom_reporters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ describe('Custom Reporters Integration', () => {
],
};

const {status} = runJest('custom_reporters', [
const {status, stdout} = runJest('custom_reporters', [
'--config',
JSON.stringify(reporterConfig),
'add.test.js',
]);

expect(stdout).toMatchSnapshot();
expect(status).toBe(0);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ test('prints a message with path pattern at the end', () => {
let stderr;

({stderr} = runJest(DIR, ['a']));
expect(stderr).toMatch('Ran all test suites matching "a"');
expect(stderr).toMatch('Ran all test suites matching /a/i');

({stderr} = runJest(DIR, ['a', 'b']));
expect(stderr).toMatch('Ran all test suites matching /a|b/');
expect(stderr).toMatch('Ran all test suites matching /a|b/i');

({stderr} = runJest(DIR, ['--testPathPattern', 'a']));
expect(stderr).toMatch('Ran all test suites matching /a/');
expect(stderr).toMatch('Ran all test suites matching /a/i');

({stderr} = runJest(DIR, ['--testPathPattern', 'a|b']));
expect(stderr).toMatch('Ran all test suites matching /a|b/');
expect(stderr).toMatch('Ran all test suites matching /a|b/i');
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`Watch mode flows Runs Jest once by default and shows usage 1`] = `
Array [
"
Watch Usage
› Press o to only run tests related to changed files.
› Press a to run all tests.
› Press p to filter by a filename regex pattern.
› Press t to filter by a test name regex pattern.
› Press q to quit watch mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,3 @@ exports[`Watch mode flows Results in pattern mode get truncated appropriately 2`
[MOCK - cursorTo(12, 5)]
[MOCK - cursorRestorePosition]"
`;

exports[`Watch mode flows can select a specific test name from the typeahead results 1`] = `"should convert string to a RegExp"`;
Loading

0 comments on commit 6e56c6e

Please sign in to comment.