From b3c78bc434ca703b19a02e90c6a3146e9b1eee9d Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Mon, 28 May 2018 00:32:04 +0100 Subject: [PATCH] Add test asserting we can have hooks in blocks with skipped tests --- .../empty-describe-with-hooks.test.js.snap | 11 +++++++++++ e2e/__tests__/empty-describe-with-hooks.test.js | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/e2e/__tests__/__snapshots__/empty-describe-with-hooks.test.js.snap b/e2e/__tests__/__snapshots__/empty-describe-with-hooks.test.js.snap index 735f97671258..6aed70d1a1aa 100644 --- a/e2e/__tests__/__snapshots__/empty-describe-with-hooks.test.js.snap +++ b/e2e/__tests__/__snapshots__/empty-describe-with-hooks.test.js.snap @@ -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: <> +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 diff --git a/e2e/__tests__/empty-describe-with-hooks.test.js b/e2e/__tests__/empty-describe-with-hooks.test.js index c283ff56dfe6..7a366e3b6bf6 100644 --- a/e2e/__tests__/empty-describe-with-hooks.test.js +++ b/e2e/__tests__/empty-describe-with-hooks.test.js @@ -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);