Skip to content

Commit

Permalink
Add test asserting we can have hooks in blocks with skipped tests
Browse files Browse the repository at this point in the history
  • Loading branch information
captbaritone committed May 27, 2018
1 parent cc417a2 commit b3c78bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions e2e/__tests__/__snapshots__/empty-describe-with-hooks.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`hook in describe with skipped test 1`] = `
Object {
"rest": "",
"summary": "Test Suites: 1 skipped, 0 of 1 total
Tests: 1 skipped, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /hook-in-describe-with-skipped-test.test.js/i.",
}
`;

exports[`hook in empty describe 1`] = `
Object {
"rest": "FAIL __tests__/hook-in-empty-describe.test.js
Expand Down
6 changes: 6 additions & 0 deletions e2e/__tests__/empty-describe-with-hooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ test('hook in empty describe', () => {
expect(extractSummary(result.stderr)).toMatchSnapshot();
});

test('hook in describe with skipped test', () => {
const result = runJest(dir, ['hook-in-describe-with-skipped-test.test.js']);
expect(result.status).toBe(0);
expect(extractSummary(result.stderr)).toMatchSnapshot();
});

test('hook in empty nested describe', () => {
const result = runJest(dir, ['hook-in-empty-nested-describe.test.js']);
expect(result.status).toBe(1);
Expand Down

0 comments on commit b3c78bc

Please sign in to comment.