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

Keep ARGV only in CLI files #4012

Merged
merged 1 commit into from
Jul 14, 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 @@ -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\\".
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed in #4006 this now prints the pattern instead of mix of pattern+raw input

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\\"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably needs to be updated too :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spare that for another PR :p

}
}"
`;
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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the actual behavior change, rather the test change because of different default mock value

› 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]"
`;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i used a direct comparison here instead of snapshot

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