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 6dd3919
Show file tree
Hide file tree
Showing 3 changed files with 28 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Copyright (c) 2018-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

describe('a block', () => {
beforeEach(() => {});
test.skip('skipped test', () => {});
});

0 comments on commit 6dd3919

Please sign in to comment.