Skip to content

Commit

Permalink
Add back support for skipped tests in the CLI. (jestjs#1836)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer authored Sep 30, 2016
1 parent ead8558 commit c7ead99
Show file tree
Hide file tree
Showing 23 changed files with 226 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ exports[`test console printing 1`] = `
exports[`test console printing 2`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 passed, 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Expand Down Expand Up @@ -50,8 +50,8 @@ exports[`test console printing with --verbose 2`] = `
exports[`test console printing with --verbose 3`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 passed, 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ All files | 100 | 100 | 100 | 100 | |
`;

exports[`test json reporter printing with --coverage 1`] = `
"Test Suites: 1 failed, 0 passed, 1 total
"Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 passed, 2 total
Snapshots: 0 passed, 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Expand Down
24 changes: 12 additions & 12 deletions integration_tests/__tests__/__snapshots__/failures-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Object {
",
"summary": "Test Suites: 1 failed, 0 passed, 1 total
Tests: 0 passed, 0 total
Snapshots: 0 passed, 0 total
"summary": "Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests matching \"throw-number-test.js\".
Ran all test suites matching \"throw-number-test.js\".
",
}
`;
Expand All @@ -25,11 +25,11 @@ Object {
banana
",
"summary": "Test Suites: 1 failed, 0 passed, 1 total
Tests: 0 passed, 0 total
Snapshots: 0 passed, 0 total
"summary": "Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests matching \"throw-string-test.js\".
Ran all test suites matching \"throw-string-test.js\".
",
}
`;
Expand All @@ -42,11 +42,11 @@ Object {
Error: No message was provided
",
"summary": "Test Suites: 1 failed, 0 passed, 1 total
Tests: 0 passed, 0 total
Snapshots: 0 passed, 0 total
"summary": "Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests matching \"throw-object-test.js\".
Ran all test suites matching \"throw-object-test.js\".
",
}
`;
22 changes: 11 additions & 11 deletions integration_tests/__tests__/__snapshots__/globals-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ exports[`test basic test constructs 1`] = `
exports[`test basic test constructs 2`] = `
"Test Suites: 1 passed, 1 total
Tests: 4 passed, 4 total
Snapshots: 0 passed, 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Expand All @@ -37,10 +37,10 @@ exports[`test only 1`] = `
exports[`test only 2`] = `
"Test Suites: 1 passed, 1 total
Tests: 7 passed, 8 total
Snapshots: 0 passed, 0 total
Tests: 1 skipped, 7 passed, 8 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Expand All @@ -64,10 +64,10 @@ exports[`test skips 1`] = `
exports[`test skips 2`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 9 total
Snapshots: 0 passed, 0 total
Tests: 8 skipped, 1 passed, 9 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Expand All @@ -82,9 +82,9 @@ exports[`test tests with no implementation 1`] = `
exports[`test tests with no implementation 2`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 3 total
Snapshots: 0 passed, 0 total
Tests: 2 skipped, 1 passed, 3 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
34 changes: 17 additions & 17 deletions integration_tests/__tests__/__snapshots__/snapshot-test.js.snap
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
exports[`Snapshot Validation deletes a snapshot when a test does removes all the snapshots 1`] = `
"Test Suites: 3 passed, 3 total
Tests: 7 passed, 7 total
Snapshots: 7 added, 0 passed, 7 total
Snapshots: 7 added, 7 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Expand All @@ -12,34 +12,34 @@ exports[`Snapshot Validation deletes a snapshot when a test does removes all the
Tests: 5 passed, 5 total
Snapshots: 4 passed, 4 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
exports[`Snapshot Validation deletes the snapshot if the test file has been removed 1`] = `
exports[`Snapshot Validation deletes the snapshot if the test suite has been removed 1`] = `
"Test Suites: 3 passed, 3 total
Tests: 7 passed, 7 total
Snapshots: 7 added, 0 passed, 7 total
Snapshots: 7 added, 7 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
exports[`Snapshot Validation deletes the snapshot if the test file has been removed 2`] = `
exports[`Snapshot Validation deletes the snapshot if the test suite has been removed 2`] = `
"Test Suites: 2 passed, 2 total
Tests: 4 passed, 4 total
Snapshots: 4 passed, 4 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
exports[`Snapshot Validation updates the snapshot when a test removes some snapshots 1`] = `
"Test Suites: 3 passed, 3 total
Tests: 7 passed, 7 total
Snapshots: 7 added, 0 passed, 7 total
Snapshots: 7 added, 7 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Expand All @@ -48,25 +48,25 @@ exports[`Snapshot Validation updates the snapshot when a test removes some snaps
Tests: 7 passed, 7 total
Snapshots: 1 updated, 5 passed, 6 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
exports[`Snapshot works as expected 1`] = `
"Test Suites: 2 passed, 2 total
Tests: 4 passed, 4 total
Snapshots: 4 added, 0 passed, 4 total
Snapshots: 4 added, 4 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
exports[`Snapshot works with escaped characters 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 1 added, 0 passed, 1 total
Snapshots: 1 added, 1 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Expand All @@ -75,7 +75,7 @@ exports[`Snapshot works with escaped characters 2`] = `
Tests: 2 passed, 2 total
Snapshots: 1 added, 1 passed, 2 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
Expand All @@ -84,6 +84,6 @@ exports[`Snapshot works with escaped characters 3`] = `
Tests: 2 passed, 2 total
Snapshots: 2 passed, 2 total
Time: <<REPLACED>>
Ran all tests.
Ran all test suites.
"
`;
48 changes: 24 additions & 24 deletions integration_tests/__tests__/__snapshots__/stack_trace-test.js.snap
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
exports[`Stack Trace does not print a stack trace for errors when --noStackTrace is given 1`] = `
"Test Suites: 1 failed, 0 passed, 1 total
Tests: 3 failed, 0 passed, 3 total
Snapshots: 0 passed, 0 total
"Test Suites: 1 failed, 1 total
Tests: 3 failed, 3 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests matching \"test-error-test.js\".
Ran all test suites matching \"test-error-test.js\".
"
`;
exports[`Stack Trace does not print a stack trace for matching errors when --noStackTrace is given 1`] = `
"Test Suites: 1 failed, 0 passed, 1 total
Tests: 1 failed, 0 passed, 1 total
Snapshots: 0 passed, 0 total
"Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests matching \"stack-trace-test.js\".
Ran all test suites matching \"stack-trace-test.js\".
"
`;
exports[`Stack Trace does not print a stack trace for runtime errors when --noStackTrace is given 1`] = `
"Test Suites: 1 failed, 0 passed, 1 total
Tests: 0 passed, 0 total
Snapshots: 0 passed, 0 total
"Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests matching \"runtime-error-test.js\".
Ran all test suites matching \"runtime-error-test.js\".
"
`;
exports[`Stack Trace prints a stack trace for errors 1`] = `
"Test Suites: 1 failed, 0 passed, 1 total
Tests: 3 failed, 0 passed, 3 total
Snapshots: 0 passed, 0 total
"Test Suites: 1 failed, 1 total
Tests: 3 failed, 3 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests matching \"test-error-test.js\".
Ran all test suites matching \"test-error-test.js\".
"
`;
exports[`Stack Trace prints a stack trace for matching errors 1`] = `
"Test Suites: 1 failed, 0 passed, 1 total
Tests: 1 failed, 0 passed, 1 total
Snapshots: 0 passed, 0 total
"Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests matching \"stack-trace-test.js\".
Ran all test suites matching \"stack-trace-test.js\".
"
`;
exports[`Stack Trace prints a stack trace for runtime errors 1`] = `
"Test Suites: 1 failed, 0 passed, 1 total
Tests: 0 passed, 0 total
Snapshots: 0 passed, 0 total
"Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all tests matching \"runtime-error-test.js\".
Ran all test suites matching \"runtime-error-test.js\".
"
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
exports[`test testNamePattern 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 2 skipped, 2 passed, 4 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites with tests matching \"should match\".
"
`;
2 changes: 1 addition & 1 deletion integration_tests/__tests__/console-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
*/
'use strict';

const {extractSummary} = require('../utils');
const runJest = require('../runJest');
const skipOnWindows = require('skipOnWindows');
const {extractSummary} = require('../utils');

skipOnWindows.suite();

Expand Down
12 changes: 6 additions & 6 deletions integration_tests/__tests__/snapshot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('Snapshot', () => {
).not.toBe(undefined);

const info = result.stderr.toString();
expect(info).toMatch('4 snapshots written in 2 test files');
expect(info).toMatch('4 snapshots written in 2 test suites');
expect(extractSummary(info).summary).toMatchSnapshot();
});

Expand Down Expand Up @@ -142,7 +142,7 @@ describe('Snapshot', () => {
fs.writeFileSync(copyOfTestPath, originalTestContent);
});

it('deletes the snapshot if the test file has been removed', () => {
it('deletes the snapshot if the test suite has been removed', () => {
const firstRun = runJest.json('snapshot', []);
fs.unlinkSync(copyOfTestPath);

Expand All @@ -156,7 +156,7 @@ describe('Snapshot', () => {

const infoFR = firstRun.stderr.toString();
const infoSR = secondRun.stderr.toString();
expect(infoFR).toMatch('7 snapshots written in 3 test files');
expect(infoFR).toMatch('7 snapshots written in 3 test suites');
expect(infoSR).toMatch('1 snapshot file removed');
expect(extractSummary(infoFR).summary).toMatchSnapshot();
expect(extractSummary(infoSR).summary).toMatchSnapshot();
Expand All @@ -175,7 +175,7 @@ describe('Snapshot', () => {
expect(fileExists(snapshotOfCopy)).toBe(false);
const infoFR = firstRun.stderr.toString();
const infoSR = secondRun.stderr.toString();
expect(infoFR).toMatch('7 snapshots written in 3 test files');
expect(infoFR).toMatch('7 snapshots written in 3 test suites');
expect(infoSR).toMatch('1 snapshot file removed');
expect(extractSummary(infoFR).summary).toMatchSnapshot();
expect(extractSummary(infoSR).summary).toMatchSnapshot();
Expand Down Expand Up @@ -216,9 +216,9 @@ describe('Snapshot', () => {

const infoFR = firstRun.stderr.toString();
const infoSR = secondRun.stderr.toString();
expect(infoFR).toMatch('7 snapshots written in 3 test files');
expect(infoFR).toMatch('7 snapshots written in 3 test suites');
expect(extractSummary(infoFR).summary).toMatchSnapshot();
expect(infoSR).toMatch('1 snapshot updated in 1 test file');
expect(infoSR).toMatch('1 snapshot updated in 1 test suite');
expect(infoSR).toMatch('1 obsolete snapshot removed');
expect(extractSummary(infoSR).summary).toMatchSnapshot();
});
Expand Down
Loading

0 comments on commit c7ead99

Please sign in to comment.