From 596422e7f0eefc2a8970ba2febc0f32b69d4b564 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Wed, 5 Jul 2023 14:14:07 +0200 Subject: [PATCH 1/4] chore: fix labelling GH action (#14300) --- .github/workflows/issues.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 91550b94622c..88dfd8f78d76 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -13,14 +13,16 @@ jobs: runs-on: ubuntu-latest steps: - if: "${{ github.event.label.name == ':speech_balloon: Question' }}" - run: gh issue close ${{ github.event.issue.number }} --comment "Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/jestjs) or our [discord channel](https://discord.gg/j6FKKQQrW9) for questions." + run: gh issue close $ISSUE --comment "Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/jestjs) or our [discord channel](https://discord.gg/j6FKKQQrW9) for questions." env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE: ${{ github.event.issue.html_url }} bug-without-repro: name: Bug reports without reproductions runs-on: ubuntu-latest steps: - if: "${{ github.event.label.name == 'Needs Reproduction' }}" - run: gh issue close ${{ github.event.issue.number }} --comment "As noted in the [Bug Report template](https://github.com/jestjs/jest/blob/main/.github/ISSUE_TEMPLATE/bug.yml), all bug reports requires a minimal reproduction. Please open up a new issue providing one. Read more at https://stackoverflow.com/help/minimal-reproducible-example." + run: gh issue close $ISSUE --comment "As noted in the [Bug Report template](https://github.com/jestjs/jest/blob/main/.github/ISSUE_TEMPLATE/bug.yml), all bug reports requires a minimal reproduction. Please open up a new issue providing one. Read more at https://stackoverflow.com/help/minimal-reproducible-example." env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE: ${{ github.event.issue.html_url }} From 208f2f177f514004ca02e40694be3a50b7aaf4f9 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 6 Jul 2023 16:15:34 +0200 Subject: [PATCH 2/4] Revert "Prevent false test failures caused by promise rejections handled asynchronously (#14110)" (#14304) --- CHANGELOG.md | 2 + .../environmentAfterTeardown.test.ts.snap | 2 +- ...vironmentAfterTeardownJasmine.test.ts.snap | 13 - .../promiseAsyncHandling.test.ts.snap | 236 ------------------ .../requireAfterTeardown.test.ts.snap | 2 +- .../requireAfterTeardownJasmine.test.ts.snap | 13 - .../environmentAfterTeardown.test.ts | 9 +- .../environmentAfterTeardownJasmine.test.ts | 21 -- e2e/__tests__/fakeTimersLegacy.test.ts | 6 +- e2e/__tests__/promiseAsyncHandling.test.ts | 71 ------ e2e/__tests__/requireAfterTeardown.test.ts | 9 +- .../requireAfterTeardownJasmine.test.ts | 22 -- .../__tests__/rejectionHandled.test.js | 74 ------ .../unhandledRejectionAfterAll.test.js | 18 -- .../unhandledRejectionAfterEach.test.js | 20 -- .../unhandledRejectionBeforeAll.test.js | 18 -- .../unhandledRejectionBeforeEach.test.js | 20 -- .../__tests__/unhandledRejectionTest.test.js | 34 --- e2e/promise-async-handling/package.json | 5 - packages/jest-circus/src/eventHandler.ts | 32 +-- .../jest-circus/src/globalErrorHandlers.ts | 38 +-- .../legacy-code-todo-rewrite/jestAdapter.ts | 1 - .../jestAdapterInit.ts | 6 - packages/jest-circus/src/state.ts | 1 - .../src/unhandledRejectionHandler.ts | 80 ------ packages/jest-circus/src/utils.ts | 1 - packages/jest-runtime/src/index.ts | 29 --- packages/jest-types/src/Circus.ts | 8 - 28 files changed, 21 insertions(+), 770 deletions(-) delete mode 100644 e2e/__tests__/__snapshots__/environmentAfterTeardownJasmine.test.ts.snap delete mode 100644 e2e/__tests__/__snapshots__/promiseAsyncHandling.test.ts.snap delete mode 100644 e2e/__tests__/__snapshots__/requireAfterTeardownJasmine.test.ts.snap delete mode 100644 e2e/__tests__/environmentAfterTeardownJasmine.test.ts delete mode 100644 e2e/__tests__/promiseAsyncHandling.test.ts delete mode 100644 e2e/__tests__/requireAfterTeardownJasmine.test.ts delete mode 100644 e2e/promise-async-handling/__tests__/rejectionHandled.test.js delete mode 100644 e2e/promise-async-handling/__tests__/unhandledRejectionAfterAll.test.js delete mode 100644 e2e/promise-async-handling/__tests__/unhandledRejectionAfterEach.test.js delete mode 100644 e2e/promise-async-handling/__tests__/unhandledRejectionBeforeAll.test.js delete mode 100644 e2e/promise-async-handling/__tests__/unhandledRejectionBeforeEach.test.js delete mode 100644 e2e/promise-async-handling/__tests__/unhandledRejectionTest.test.js delete mode 100644 e2e/promise-async-handling/package.json delete mode 100644 packages/jest-circus/src/unhandledRejectionHandler.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dc492183d40..144b2e2152c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Fixes +- `[jest-circus]` Revert [#14110](https://github.com/jestjs/jest/pull/14110) as it was a breaking change + ### Chore & Maintenance ### Performance diff --git a/e2e/__tests__/__snapshots__/environmentAfterTeardown.test.ts.snap b/e2e/__tests__/__snapshots__/environmentAfterTeardown.test.ts.snap index ced63eb48256..e851be178ae8 100644 --- a/e2e/__tests__/__snapshots__/environmentAfterTeardown.test.ts.snap +++ b/e2e/__tests__/__snapshots__/environmentAfterTeardown.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`prints useful error for environment methods after test is done 1`] = ` -" ReferenceError: You are trying to access a property or method of the Jest environment outside of the scope of the test code. +"ReferenceError: You are trying to access a property or method of the Jest environment after it has been torn down. From __tests__/afterTeardown.test.js. 9 | test('access environment methods after done', () => { 10 | setTimeout(() => { diff --git a/e2e/__tests__/__snapshots__/environmentAfterTeardownJasmine.test.ts.snap b/e2e/__tests__/__snapshots__/environmentAfterTeardownJasmine.test.ts.snap deleted file mode 100644 index e851be178ae8..000000000000 --- a/e2e/__tests__/__snapshots__/environmentAfterTeardownJasmine.test.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`prints useful error for environment methods after test is done 1`] = ` -"ReferenceError: You are trying to access a property or method of the Jest environment after it has been torn down. From __tests__/afterTeardown.test.js. - - 9 | test('access environment methods after done', () => { - 10 | setTimeout(() => { - > 11 | jest.clearAllTimers(); - | ^ - 12 | }, 0); - 13 | }); - 14 |" -`; diff --git a/e2e/__tests__/__snapshots__/promiseAsyncHandling.test.ts.snap b/e2e/__tests__/__snapshots__/promiseAsyncHandling.test.ts.snap deleted file mode 100644 index 402a65e570c7..000000000000 --- a/e2e/__tests__/__snapshots__/promiseAsyncHandling.test.ts.snap +++ /dev/null @@ -1,236 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`fails because of unhandled promise rejection in afterAll hook 1`] = ` -Object { - "rest": "FAIL __tests__/unhandledRejectionAfterAll.test.js - - - ● Test suite failed to run - - REJECTED - - 11 | - 12 | afterAll(async () => { - > 13 | Promise.reject(new Error('REJECTED')); - | ^ - 14 | - 15 | await promisify(setTimeout)(0); - 16 | }); - - at Object. (__tests__/unhandledRejectionAfterAll.test.js:13:18)", - "summary": "Test Suites: 1 failed, 1 total -Tests: 1 passed, 1 total -Snapshots: 0 total -Time: <> -Ran all test suites matching /unhandledRejectionAfterAll.test.js/i.", -} -`; - -exports[`fails because of unhandled promise rejection in afterEach hook 1`] = ` -Object { - "rest": "FAIL __tests__/unhandledRejectionAfterEach.test.js - ✕ foo #1 - ✕ foo #2 - - ● foo #1 - - REJECTED - - 11 | - 12 | afterEach(async () => { - > 13 | Promise.reject(new Error('REJECTED')); - | ^ - 14 | - 15 | await promisify(setTimeout)(0); - 16 | }); - - at Object. (__tests__/unhandledRejectionAfterEach.test.js:13:18) - - ● foo #2 - - REJECTED - - 11 | - 12 | afterEach(async () => { - > 13 | Promise.reject(new Error('REJECTED')); - | ^ - 14 | - 15 | await promisify(setTimeout)(0); - 16 | }); - - at Object. (__tests__/unhandledRejectionAfterEach.test.js:13:18)", - "summary": "Test Suites: 1 failed, 1 total -Tests: 2 failed, 2 total -Snapshots: 0 total -Time: <> -Ran all test suites matching /unhandledRejectionAfterEach.test.js/i.", -} -`; - -exports[`fails because of unhandled promise rejection in beforeAll hook 1`] = ` -Object { - "rest": "FAIL __tests__/unhandledRejectionBeforeAll.test.js - ✕ foo - - ● foo - - REJECTED - - 11 | - 12 | beforeAll(async () => { - > 13 | Promise.reject(new Error('REJECTED')); - | ^ - 14 | - 15 | await promisify(setTimeout)(0); - 16 | }); - - at Object. (__tests__/unhandledRejectionBeforeAll.test.js:13:18)", - "summary": "Test Suites: 1 failed, 1 total -Tests: 1 failed, 1 total -Snapshots: 0 total -Time: <> -Ran all test suites matching /unhandledRejectionBeforeAll.test.js/i.", -} -`; - -exports[`fails because of unhandled promise rejection in beforeEach hook 1`] = ` -Object { - "rest": "FAIL __tests__/unhandledRejectionBeforeEach.test.js - ✕ foo #1 - ✕ foo #2 - - ● foo #1 - - REJECTED - - 11 | - 12 | beforeEach(async () => { - > 13 | Promise.reject(new Error('REJECTED')); - | ^ - 14 | - 15 | await promisify(setTimeout)(0); - 16 | }); - - at Object. (__tests__/unhandledRejectionBeforeEach.test.js:13:18) - - ● foo #2 - - REJECTED - - 11 | - 12 | beforeEach(async () => { - > 13 | Promise.reject(new Error('REJECTED')); - | ^ - 14 | - 15 | await promisify(setTimeout)(0); - 16 | }); - - at Object. (__tests__/unhandledRejectionBeforeEach.test.js:13:18)", - "summary": "Test Suites: 1 failed, 1 total -Tests: 2 failed, 2 total -Snapshots: 0 total -Time: <> -Ran all test suites matching /unhandledRejectionBeforeEach.test.js/i.", -} -`; - -exports[`fails because of unhandled promise rejection in test 1`] = ` -Object { - "rest": "FAIL __tests__/unhandledRejectionTest.test.js - ✕ w/o event loop turn after rejection - ✕ w/ event loop turn after rejection in async function - ✕ w/ event loop turn after rejection in sync function - ✕ combined w/ another failure _after_ promise rejection - - ● w/o event loop turn after rejection - - REJECTED - - 11 | - 12 | test('w/o event loop turn after rejection', () => { - > 13 | Promise.reject(new Error('REJECTED')); - | ^ - 14 | }); - 15 | - 16 | test('w/ event loop turn after rejection in async function', async () => { - - at Object. (__tests__/unhandledRejectionTest.test.js:13:18) - - ● w/ event loop turn after rejection in async function - - REJECTED - - 15 | - 16 | test('w/ event loop turn after rejection in async function', async () => { - > 17 | Promise.reject(new Error('REJECTED')); - | ^ - 18 | - 19 | await promisify(setTimeout)(0); - 20 | }); - - at Object. (__tests__/unhandledRejectionTest.test.js:17:18) - - ● w/ event loop turn after rejection in sync function - - REJECTED - - 21 | - 22 | test('w/ event loop turn after rejection in sync function', done => { - > 23 | Promise.reject(new Error('REJECTED')); - | ^ - 24 | - 25 | setTimeout(done, 0); - 26 | }); - - at Object. (__tests__/unhandledRejectionTest.test.js:23:18) - - ● combined w/ another failure _after_ promise rejection - - expect(received).toBe(expected) // Object.is equality - - Expected: false - Received: true - - 31 | await promisify(setTimeout)(0); - 32 | - > 33 | expect(true).toBe(false); - | ^ - 34 | }); - 35 | - - at Object.toBe (__tests__/unhandledRejectionTest.test.js:33:16) - - ● combined w/ another failure _after_ promise rejection - - REJECTED - - 27 | - 28 | test('combined w/ another failure _after_ promise rejection', async () => { - > 29 | Promise.reject(new Error('REJECTED')); - | ^ - 30 | - 31 | await promisify(setTimeout)(0); - 32 | - - at Object. (__tests__/unhandledRejectionTest.test.js:29:18)", - "summary": "Test Suites: 1 failed, 1 total -Tests: 4 failed, 4 total -Snapshots: 0 total -Time: <> -Ran all test suites matching /unhandledRejectionTest.test.js/i.", -} -`; - -exports[`succeeds for async handled promise rejections 1`] = ` -Object { - "rest": "PASS __tests__/rejectionHandled.test.js - ✓ async function succeeds because the promise is eventually awaited by assertion - ✓ async function succeeds because the promise is eventually directly awaited - ✓ sync function succeeds because the promise is eventually handled by \`.catch\` handler", - "summary": "Test Suites: 1 passed, 1 total -Tests: 3 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites matching /rejectionHandled.test.js/i.", -} -`; diff --git a/e2e/__tests__/__snapshots__/requireAfterTeardown.test.ts.snap b/e2e/__tests__/__snapshots__/requireAfterTeardown.test.ts.snap index afa6ff3749e2..1a3d3fd9b988 100644 --- a/e2e/__tests__/__snapshots__/requireAfterTeardown.test.ts.snap +++ b/e2e/__tests__/__snapshots__/requireAfterTeardown.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`prints useful error for requires after test is done 1`] = ` -" ReferenceError: You are trying to \`import\` a file outside of the scope of the test code. +"ReferenceError: You are trying to \`import\` a file after the Jest environment has been torn down. From __tests__/lateRequire.test.js. 9 | test('require after done', () => { 10 | setTimeout(() => { diff --git a/e2e/__tests__/__snapshots__/requireAfterTeardownJasmine.test.ts.snap b/e2e/__tests__/__snapshots__/requireAfterTeardownJasmine.test.ts.snap deleted file mode 100644 index 1a3d3fd9b988..000000000000 --- a/e2e/__tests__/__snapshots__/requireAfterTeardownJasmine.test.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`prints useful error for requires after test is done 1`] = ` -"ReferenceError: You are trying to \`import\` a file after the Jest environment has been torn down. From __tests__/lateRequire.test.js. - - 9 | test('require after done', () => { - 10 | setTimeout(() => { - > 11 | const double = require('../'); - | ^ - 12 | - 13 | expect(double(5)).toBe(10); - 14 | }, 0);" -`; diff --git a/e2e/__tests__/environmentAfterTeardown.test.ts b/e2e/__tests__/environmentAfterTeardown.test.ts index 7e71888b5ddb..1216014a2af4 100644 --- a/e2e/__tests__/environmentAfterTeardown.test.ts +++ b/e2e/__tests__/environmentAfterTeardown.test.ts @@ -5,17 +5,14 @@ * LICENSE file in the root directory of this source tree. */ -import {skipSuiteOnJasmine} from '@jest/test-utils'; import runJest from '../runJest'; -skipSuiteOnJasmine(); - test('prints useful error for environment methods after test is done', () => { const {stderr} = runJest('environment-after-teardown'); - const interestingLines = stderr.split('\n').slice(5, 14).join('\n'); + const interestingLines = stderr.split('\n').slice(9, 18).join('\n'); expect(interestingLines).toMatchSnapshot(); - expect(stderr.split('\n')[5]).toMatch( - 'ReferenceError: You are trying to access a property or method of the Jest environment outside of the scope of the test code.', + expect(stderr.split('\n')[9]).toBe( + 'ReferenceError: You are trying to access a property or method of the Jest environment after it has been torn down. From __tests__/afterTeardown.test.js.', ); }); diff --git a/e2e/__tests__/environmentAfterTeardownJasmine.test.ts b/e2e/__tests__/environmentAfterTeardownJasmine.test.ts deleted file mode 100644 index 36e769478e0f..000000000000 --- a/e2e/__tests__/environmentAfterTeardownJasmine.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import {skipSuiteOnJestCircus} from '@jest/test-utils'; -import runJest from '../runJest'; - -skipSuiteOnJestCircus(); - -test('prints useful error for environment methods after test is done', () => { - const {stderr} = runJest('environment-after-teardown'); - const interestingLines = stderr.split('\n').slice(9, 18).join('\n'); - - expect(interestingLines).toMatchSnapshot(); - expect(stderr.split('\n')[9]).toBe( - 'ReferenceError: You are trying to access a property or method of the Jest environment after it has been torn down. From __tests__/afterTeardown.test.js.', - ); -}); diff --git a/e2e/__tests__/fakeTimersLegacy.test.ts b/e2e/__tests__/fakeTimersLegacy.test.ts index 3ad3f3a7fb3f..268ce5aa80c2 100644 --- a/e2e/__tests__/fakeTimersLegacy.test.ts +++ b/e2e/__tests__/fakeTimersLegacy.test.ts @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import {isJestJasmineRun} from '@jest/test-utils'; import runJest from '../runJest'; describe('enableGlobally', () => { @@ -40,13 +39,10 @@ describe('requestAnimationFrame', () => { describe('setImmediate', () => { test('fakes setImmediate', () => { - // Jasmine runner does not handle unhandled promise rejections that are causing the test to fail in Jest circus - const expectedExitCode = isJestJasmineRun() ? 0 : 1; - const result = runJest('fake-timers-legacy/set-immediate'); expect(result.stderr).toMatch('setImmediate test'); - expect(result.exitCode).toBe(expectedExitCode); + expect(result.exitCode).toBe(0); }); }); diff --git a/e2e/__tests__/promiseAsyncHandling.test.ts b/e2e/__tests__/promiseAsyncHandling.test.ts deleted file mode 100644 index 606bae071097..000000000000 --- a/e2e/__tests__/promiseAsyncHandling.test.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import * as path from 'path'; -import {skipSuiteOnJasmine} from '@jest/test-utils'; -import {extractSortedSummary} from '../Utils'; -import runJest from '../runJest'; - -const dir = path.resolve(__dirname, '../promise-async-handling'); - -skipSuiteOnJasmine(); - -test('fails because of unhandled promise rejection in test', () => { - const {stderr, exitCode} = runJest(dir, ['unhandledRejectionTest.test.js']); - - expect(exitCode).toBe(1); - const sortedSummary = extractSortedSummary(stderr); - expect(sortedSummary).toMatchSnapshot(); -}); - -test('fails because of unhandled promise rejection in beforeAll hook', () => { - const {stderr, exitCode} = runJest(dir, [ - 'unhandledRejectionBeforeAll.test.js', - ]); - - expect(exitCode).toBe(1); - const sortedSummary = extractSortedSummary(stderr); - expect(sortedSummary).toMatchSnapshot(); -}); - -test('fails because of unhandled promise rejection in beforeEach hook', () => { - const {stderr, exitCode} = runJest(dir, [ - 'unhandledRejectionBeforeEach.test.js', - ]); - - expect(exitCode).toBe(1); - const sortedSummary = extractSortedSummary(stderr); - expect(sortedSummary).toMatchSnapshot(); -}); - -test('fails because of unhandled promise rejection in afterEach hook', () => { - const {stderr, exitCode} = runJest(dir, [ - 'unhandledRejectionAfterEach.test.js', - ]); - - expect(exitCode).toBe(1); - const sortedSummary = extractSortedSummary(stderr); - expect(sortedSummary).toMatchSnapshot(); -}); - -test('fails because of unhandled promise rejection in afterAll hook', () => { - const {stderr, exitCode} = runJest(dir, [ - 'unhandledRejectionAfterAll.test.js', - ]); - - expect(exitCode).toBe(1); - const sortedSummary = extractSortedSummary(stderr); - expect(sortedSummary).toMatchSnapshot(); -}); - -test('succeeds for async handled promise rejections', () => { - const {stderr, exitCode} = runJest(dir, ['rejectionHandled.test.js']); - - expect(exitCode).toBe(0); - const sortedSummary = extractSortedSummary(stderr); - expect(sortedSummary).toMatchSnapshot(); -}); diff --git a/e2e/__tests__/requireAfterTeardown.test.ts b/e2e/__tests__/requireAfterTeardown.test.ts index 764a593db864..cb9607549b85 100644 --- a/e2e/__tests__/requireAfterTeardown.test.ts +++ b/e2e/__tests__/requireAfterTeardown.test.ts @@ -5,18 +5,15 @@ * LICENSE file in the root directory of this source tree. */ -import {skipSuiteOnJasmine} from '@jest/test-utils'; import runJest from '../runJest'; -skipSuiteOnJasmine(); - test('prints useful error for requires after test is done', () => { const {stderr} = runJest('require-after-teardown'); - const interestingLines = stderr.split('\n').slice(5, 14).join('\n'); + const interestingLines = stderr.split('\n').slice(9, 18).join('\n'); expect(interestingLines).toMatchSnapshot(); - expect(stderr.split('\n')[16]).toMatch( - '(__tests__/lateRequire.test.js:11:20)', + expect(stderr.split('\n')[19]).toMatch( + new RegExp('(__tests__/lateRequire.test.js:11:20)'), ); }); diff --git a/e2e/__tests__/requireAfterTeardownJasmine.test.ts b/e2e/__tests__/requireAfterTeardownJasmine.test.ts deleted file mode 100644 index 3eeb390ad8ea..000000000000 --- a/e2e/__tests__/requireAfterTeardownJasmine.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import {skipSuiteOnJestCircus} from '@jest/test-utils'; -import runJest from '../runJest'; - -skipSuiteOnJestCircus(); - -test('prints useful error for requires after test is done', () => { - const {stderr} = runJest('require-after-teardown'); - - const interestingLines = stderr.split('\n').slice(9, 18).join('\n'); - - expect(interestingLines).toMatchSnapshot(); - expect(stderr.split('\n')[19]).toMatch( - '(__tests__/lateRequire.test.js:11:20)', - ); -}); diff --git a/e2e/promise-async-handling/__tests__/rejectionHandled.test.js b/e2e/promise-async-handling/__tests__/rejectionHandled.test.js deleted file mode 100644 index c36e9b8d6f0f..000000000000 --- a/e2e/promise-async-handling/__tests__/rejectionHandled.test.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -'use strict'; - -const {promisify} = require('util'); - -beforeAll(async () => { - const promise = Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); - - await expect(promise).rejects.toThrow(/REJECTED/); -}); - -beforeEach(async () => { - const promise = Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); - - await expect(promise).rejects.toThrow(/REJECTED/); -}); - -afterEach(async () => { - const promise = Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); - - await expect(promise).rejects.toThrow(/REJECTED/); -}); - -afterAll(async () => { - const promise = Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); - - await expect(promise).rejects.toThrow(/REJECTED/); -}); - -test('async function succeeds because the promise is eventually awaited by assertion', async () => { - const promise = Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); - - await expect(promise).rejects.toThrow(/REJECTED/); -}); - -test('async function succeeds because the promise is eventually directly awaited', async () => { - const promise = Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); - - try { - await promise; - } catch (error) { - expect(error).toEqual(new Error('REJECTED')); - } -}); - -test('sync function succeeds because the promise is eventually handled by `.catch` handler', done => { - const promise = Promise.reject(new Error('REJECTED')); - - setTimeout(() => { - promise - .catch(error => { - expect(error).toEqual(new Error('REJECTED')); - }) - .finally(done); - }, 0); -}); diff --git a/e2e/promise-async-handling/__tests__/unhandledRejectionAfterAll.test.js b/e2e/promise-async-handling/__tests__/unhandledRejectionAfterAll.test.js deleted file mode 100644 index e6fdf75760ca..000000000000 --- a/e2e/promise-async-handling/__tests__/unhandledRejectionAfterAll.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -'use strict'; - -const {promisify} = require('util'); - -afterAll(async () => { - Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); -}); - -test('foo', () => {}); diff --git a/e2e/promise-async-handling/__tests__/unhandledRejectionAfterEach.test.js b/e2e/promise-async-handling/__tests__/unhandledRejectionAfterEach.test.js deleted file mode 100644 index 6c77b8159630..000000000000 --- a/e2e/promise-async-handling/__tests__/unhandledRejectionAfterEach.test.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -'use strict'; - -const {promisify} = require('util'); - -afterEach(async () => { - Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); -}); - -test('foo #1', () => {}); - -test('foo #2', () => {}); diff --git a/e2e/promise-async-handling/__tests__/unhandledRejectionBeforeAll.test.js b/e2e/promise-async-handling/__tests__/unhandledRejectionBeforeAll.test.js deleted file mode 100644 index af4654197346..000000000000 --- a/e2e/promise-async-handling/__tests__/unhandledRejectionBeforeAll.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -'use strict'; - -const {promisify} = require('util'); - -beforeAll(async () => { - Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); -}); - -test('foo', () => {}); diff --git a/e2e/promise-async-handling/__tests__/unhandledRejectionBeforeEach.test.js b/e2e/promise-async-handling/__tests__/unhandledRejectionBeforeEach.test.js deleted file mode 100644 index 28f3186d736c..000000000000 --- a/e2e/promise-async-handling/__tests__/unhandledRejectionBeforeEach.test.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -'use strict'; - -const {promisify} = require('util'); - -beforeEach(async () => { - Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); -}); - -test('foo #1', () => {}); - -test('foo #2', () => {}); diff --git a/e2e/promise-async-handling/__tests__/unhandledRejectionTest.test.js b/e2e/promise-async-handling/__tests__/unhandledRejectionTest.test.js deleted file mode 100644 index f63e5772c2e6..000000000000 --- a/e2e/promise-async-handling/__tests__/unhandledRejectionTest.test.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -'use strict'; - -const {promisify} = require('util'); - -test('w/o event loop turn after rejection', () => { - Promise.reject(new Error('REJECTED')); -}); - -test('w/ event loop turn after rejection in async function', async () => { - Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); -}); - -test('w/ event loop turn after rejection in sync function', done => { - Promise.reject(new Error('REJECTED')); - - setTimeout(done, 0); -}); - -test('combined w/ another failure _after_ promise rejection', async () => { - Promise.reject(new Error('REJECTED')); - - await promisify(setTimeout)(0); - - expect(true).toBe(false); -}); diff --git a/e2e/promise-async-handling/package.json b/e2e/promise-async-handling/package.json deleted file mode 100644 index 148788b25446..000000000000 --- a/e2e/promise-async-handling/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "jest": { - "testEnvironment": "node" - } -} diff --git a/packages/jest-circus/src/eventHandler.ts b/packages/jest-circus/src/eventHandler.ts index f051bf1c1588..0a437df1ed9a 100644 --- a/packages/jest-circus/src/eventHandler.ts +++ b/packages/jest-circus/src/eventHandler.ts @@ -269,35 +269,9 @@ const eventHandler: Circus.EventHandler = (event, state) => { // execution, which will result in one test's error failing another test. // In any way, it should be possible to track where the error was thrown // from. - if (state.currentlyRunningTest) { - if (event.promise) { - state.currentlyRunningTest.unhandledRejectionErrorByPromise.set( - event.promise, - event.error, - ); - } else { - state.currentlyRunningTest.errors.push(event.error); - } - } else { - if (event.promise) { - state.unhandledRejectionErrorByPromise.set( - event.promise, - event.error, - ); - } else { - state.unhandledErrors.push(event.error); - } - } - break; - } - case 'error_handled': { - if (state.currentlyRunningTest) { - state.currentlyRunningTest.unhandledRejectionErrorByPromise.delete( - event.promise, - ); - } else { - state.unhandledRejectionErrorByPromise.delete(event.promise); - } + state.currentlyRunningTest + ? state.currentlyRunningTest.errors.push(event.error) + : state.unhandledErrors.push(event.error); break; } } diff --git a/packages/jest-circus/src/globalErrorHandlers.ts b/packages/jest-circus/src/globalErrorHandlers.ts index b46b17881e96..27146fc4a1f2 100644 --- a/packages/jest-circus/src/globalErrorHandlers.ts +++ b/packages/jest-circus/src/globalErrorHandlers.ts @@ -8,50 +8,29 @@ import type {Circus} from '@jest/types'; import {dispatchSync} from './state'; -const uncaughtExceptionListener: NodeJS.UncaughtExceptionListener = ( - error: unknown, -) => { +const uncaught: NodeJS.UncaughtExceptionListener & + NodeJS.UnhandledRejectionListener = (error: unknown) => { dispatchSync({error, name: 'error'}); }; -const unhandledRejectionListener: NodeJS.UnhandledRejectionListener = ( - error: unknown, - promise: Promise, -) => { - dispatchSync({error, name: 'error', promise}); -}; - -const rejectionHandledListener: NodeJS.RejectionHandledListener = ( - promise: Promise, -) => { - dispatchSync({name: 'error_handled', promise}); -}; - export const injectGlobalErrorHandlers = ( parentProcess: NodeJS.Process, ): Circus.GlobalErrorHandlers => { const uncaughtException = process.listeners('uncaughtException').slice(); const unhandledRejection = process.listeners('unhandledRejection').slice(); - const rejectionHandled = process.listeners('rejectionHandled').slice(); parentProcess.removeAllListeners('uncaughtException'); parentProcess.removeAllListeners('unhandledRejection'); - parentProcess.removeAllListeners('rejectionHandled'); - parentProcess.on('uncaughtException', uncaughtExceptionListener); - parentProcess.on('unhandledRejection', unhandledRejectionListener); - parentProcess.on('rejectionHandled', rejectionHandledListener); - return {rejectionHandled, uncaughtException, unhandledRejection}; + parentProcess.on('uncaughtException', uncaught); + parentProcess.on('unhandledRejection', uncaught); + return {uncaughtException, unhandledRejection}; }; export const restoreGlobalErrorHandlers = ( parentProcess: NodeJS.Process, originalErrorHandlers: Circus.GlobalErrorHandlers, ): void => { - parentProcess.removeListener('uncaughtException', uncaughtExceptionListener); - parentProcess.removeListener( - 'unhandledRejection', - unhandledRejectionListener, - ); - parentProcess.removeListener('rejectionHandled', rejectionHandledListener); + parentProcess.removeListener('uncaughtException', uncaught); + parentProcess.removeListener('unhandledRejection', uncaught); for (const listener of originalErrorHandlers.uncaughtException) { parentProcess.on('uncaughtException', listener); @@ -59,7 +38,4 @@ export const restoreGlobalErrorHandlers = ( for (const listener of originalErrorHandlers.unhandledRejection) { parentProcess.on('unhandledRejection', listener); } - for (const listener of originalErrorHandlers.rejectionHandled) { - parentProcess.on('rejectionHandled', listener); - } }; diff --git a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts index 1aae32296423..80b4503621b7 100644 --- a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts +++ b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts @@ -33,7 +33,6 @@ const jestAdapter = async ( globalConfig, localRequire: runtime.requireModule.bind(runtime), parentProcess: process, - runtime, sendMessageToJest, setGlobalsForRuntime: runtime.setGlobalsForRuntime.bind(runtime), testPath, diff --git a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts index 416d6555ddbf..f9ac8076bd55 100644 --- a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts +++ b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts @@ -16,7 +16,6 @@ import { } from '@jest/test-result'; import type {Circus, Config, Global} from '@jest/types'; import {formatExecError, formatResultsErrors} from 'jest-message-util'; -import type Runtime from 'jest-runtime'; import { SnapshotState, addSerializer, @@ -31,7 +30,6 @@ import { getState as getRunnerState, } from '../state'; import testCaseReportHandler from '../testCaseReportHandler'; -import {unhandledRejectionHandler} from '../unhandledRejectionHandler'; import {getTestID} from '../utils'; interface RuntimeGlobals extends Global.TestFrameworkGlobals { @@ -41,7 +39,6 @@ interface RuntimeGlobals extends Global.TestFrameworkGlobals { export const initialize = async ({ config, environment, - runtime, globalConfig, localRequire, parentProcess, @@ -51,7 +48,6 @@ export const initialize = async ({ }: { config: Config.ProjectConfig; environment: JestEnvironment; - runtime: Runtime; globalConfig: Config.GlobalConfig; localRequire: (path: string) => T; testPath: string; @@ -133,8 +129,6 @@ export const initialize = async ({ addEventHandler(testCaseReportHandler(testPath, sendMessageToJest)); } - addEventHandler(unhandledRejectionHandler(runtime)); - // Return it back to the outer scope (test runner outside the VM). return {globals: globalsObject, snapshotState}; }; diff --git a/packages/jest-circus/src/state.ts b/packages/jest-circus/src/state.ts index 5dbc152f8399..0540dfd41116 100644 --- a/packages/jest-circus/src/state.ts +++ b/packages/jest-circus/src/state.ts @@ -34,7 +34,6 @@ const createState = (): Circus.State => { testNamePattern: null, testTimeout: 5000, unhandledErrors: [], - unhandledRejectionErrorByPromise: new Map(), }; }; diff --git a/packages/jest-circus/src/unhandledRejectionHandler.ts b/packages/jest-circus/src/unhandledRejectionHandler.ts deleted file mode 100644 index 309f9e0b2e10..000000000000 --- a/packages/jest-circus/src/unhandledRejectionHandler.ts +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import type {Circus} from '@jest/types'; -import type Runtime from 'jest-runtime'; -import {addErrorToEachTestUnderDescribe, invariant} from './utils'; - -// Global values can be overwritten by mocks or tests. We'll capture -// the original values in the variables before we require any files. -const {setTimeout} = globalThis; - -const untilNextEventLoopTurn = async () => { - return new Promise(resolve => { - setTimeout(resolve, 0); - }); -}; - -export const unhandledRejectionHandler = ( - runtime: Runtime, -): Circus.EventHandler => { - return async (event, state) => { - if (event.name === 'hook_start') { - runtime.enterTestCode(); - } else if (event.name === 'hook_success' || event.name === 'hook_failure') { - runtime.leaveTestCode(); - - // We need to give event loop the time to actually execute `rejectionHandled`, `uncaughtException` or `unhandledRejection` events - await untilNextEventLoopTurn(); - - const {test, describeBlock, hook} = event; - const {asyncError, type} = hook; - - if (type === 'beforeAll') { - invariant(describeBlock, 'always present for `*All` hooks'); - for (const error of state.unhandledRejectionErrorByPromise.values()) { - addErrorToEachTestUnderDescribe(describeBlock, error, asyncError); - } - } else if (type === 'afterAll') { - // Attaching `afterAll` errors to each test makes execution flow - // too complicated, so we'll consider them to be global. - for (const error of state.unhandledRejectionErrorByPromise.values()) { - state.unhandledErrors.push([error, asyncError]); - } - } else { - invariant(test, 'always present for `*Each` hooks'); - for (const error of test.unhandledRejectionErrorByPromise.values()) { - test.errors.push([error, asyncError]); - } - } - } else if (event.name === 'test_fn_start') { - runtime.enterTestCode(); - } else if ( - event.name === 'test_fn_success' || - event.name === 'test_fn_failure' - ) { - runtime.leaveTestCode(); - - // We need to give event loop the time to actually execute `rejectionHandled`, `uncaughtException` or `unhandledRejection` events - await untilNextEventLoopTurn(); - - const {test} = event; - invariant(test, 'always present for `*Each` hooks'); - - for (const error of test.unhandledRejectionErrorByPromise.values()) { - test.errors.push([error, event.test.asyncError]); - } - } else if (event.name === 'teardown') { - // We need to give event loop the time to actually execute `rejectionHandled`, `uncaughtException` or `unhandledRejection` events - await untilNextEventLoopTurn(); - - state.unhandledErrors.push( - ...state.unhandledRejectionErrorByPromise.values(), - ); - } - }; -}; diff --git a/packages/jest-circus/src/utils.ts b/packages/jest-circus/src/utils.ts index 9c902cc34836..ff8f3bd55022 100644 --- a/packages/jest-circus/src/utils.ts +++ b/packages/jest-circus/src/utils.ts @@ -85,7 +85,6 @@ export const makeTest = ( startedAt: null, status: null, timeout, - unhandledRejectionErrorByPromise: new Map(), }); // Traverse the tree of describe blocks and return true if at least one describe diff --git a/packages/jest-runtime/src/index.ts b/packages/jest-runtime/src/index.ts index 79528b4017b9..b34ecdfe3890 100644 --- a/packages/jest-runtime/src/index.ts +++ b/packages/jest-runtime/src/index.ts @@ -208,7 +208,6 @@ export default class Runtime { private readonly esmConditions: Array; private readonly cjsConditions: Array; private isTornDown = false; - private isInsideTestCode: boolean | undefined; constructor( config: Config.ProjectConfig, @@ -563,11 +562,6 @@ export default class Runtime { // @ts-expect-error - exiting return; } - if (this.isInsideTestCode === false) { - throw new ReferenceError( - 'You are trying to `import` a file outside of the scope of the test code.', - ); - } if (specifier === '@jest/globals') { const fromCache = this._esmoduleRegistry.get('@jest/globals'); @@ -712,11 +706,6 @@ export default class Runtime { process.exitCode = 1; return; } - if (this.isInsideTestCode === false) { - throw new ReferenceError( - 'You are trying to `import` a file outside of the scope of the test code.', - ); - } if (module.status === 'unlinked') { // since we might attempt to link the same module in parallel, stick the promise in a weak map so every call to @@ -1354,14 +1343,6 @@ export default class Runtime { this._moduleMocker.clearAllMocks(); } - enterTestCode(): void { - this.isInsideTestCode = true; - } - - leaveTestCode(): void { - this.isInsideTestCode = false; - } - teardown(): void { this.restoreAllMocks(); this.resetModules(); @@ -1505,11 +1486,6 @@ export default class Runtime { process.exitCode = 1; return; } - if (this.isInsideTestCode === false) { - throw new ReferenceError( - 'You are trying to `import` a file outside of the scope of the test code.', - ); - } // If the environment was disposed, prevent this module from being executed. if (!this._environment.global) { @@ -2195,11 +2171,6 @@ export default class Runtime { ); process.exitCode = 1; } - if (this.isInsideTestCode === false) { - throw new ReferenceError( - 'You are trying to access a property or method of the Jest environment outside of the scope of the test code.', - ); - } return this._fakeTimersImplementation!; }; diff --git a/packages/jest-types/src/Circus.ts b/packages/jest-types/src/Circus.ts index 722b2a9a4db1..2b27c314f541 100644 --- a/packages/jest-types/src/Circus.ts +++ b/packages/jest-types/src/Circus.ts @@ -81,11 +81,6 @@ export type SyncEvent = // an `afterAll` hook) name: 'error'; error: Exception; - promise?: Promise; - } - | { - name: 'error_handled'; - promise: Promise; }; export type AsyncEvent = @@ -218,7 +213,6 @@ export type RunResult = { export type TestResults = Array; export type GlobalErrorHandlers = { - rejectionHandled: Array<(promise: Promise) => void>; uncaughtException: Array<(exception: Exception) => void>; unhandledRejection: Array< (exception: Exception, promise: Promise) => void @@ -244,7 +238,6 @@ export type State = { unhandledErrors: Array; includeTestLocationInResult: boolean; maxConcurrency: number; - unhandledRejectionErrorByPromise: Map, Exception>; }; export type DescribeBlock = { @@ -278,5 +271,4 @@ export type TestEntry = { status?: TestStatus | null; // whether the test has been skipped or run already timeout?: number; failing: boolean; - unhandledRejectionErrorByPromise: Map, Exception>; }; From 12779472553026cccd7b735ac8fc1a9fa2e606b3 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 6 Jul 2023 16:17:33 +0200 Subject: [PATCH 3/4] chore: update changelog for release --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 144b2e2152c8..c223e90f5725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,16 @@ ### Fixes -- `[jest-circus]` Revert [#14110](https://github.com/jestjs/jest/pull/14110) as it was a breaking change - ### Chore & Maintenance ### Performance +## 29.6.1 + +### Fixes + +- `[jest-circus]` Revert [#14110](https://github.com/jestjs/jest/pull/14110) as it was a breaking change + ## 29.6.0 ### Features From 1f019afdcdfc54a6664908bb45f343db4e3d0848 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 6 Jul 2023 16:18:02 +0200 Subject: [PATCH 4/4] v29.6.1 --- lerna.json | 2 +- packages/babel-jest/package.json | 2 +- packages/expect-utils/package.json | 2 +- packages/expect/package.json | 2 +- packages/jest-circus/package.json | 2 +- packages/jest-cli/package.json | 2 +- packages/jest-config/package.json | 2 +- packages/jest-console/package.json | 2 +- packages/jest-core/package.json | 2 +- packages/jest-create-cache-key-function/package.json | 2 +- packages/jest-diff/package.json | 2 +- packages/jest-each/package.json | 2 +- packages/jest-environment-jsdom/package.json | 2 +- packages/jest-environment-node/package.json | 2 +- packages/jest-environment/package.json | 2 +- packages/jest-expect/package.json | 2 +- packages/jest-fake-timers/package.json | 2 +- packages/jest-globals/package.json | 2 +- packages/jest-haste-map/package.json | 2 +- packages/jest-jasmine2/package.json | 2 +- packages/jest-leak-detector/package.json | 2 +- packages/jest-matcher-utils/package.json | 2 +- packages/jest-message-util/package.json | 2 +- packages/jest-mock/package.json | 2 +- packages/jest-phabricator/package.json | 2 +- packages/jest-repl/package.json | 2 +- packages/jest-reporters/package.json | 2 +- packages/jest-resolve-dependencies/package.json | 2 +- packages/jest-resolve/package.json | 2 +- packages/jest-runner/package.json | 2 +- packages/jest-runtime/package.json | 2 +- packages/jest-snapshot/package.json | 2 +- packages/jest-test-result/package.json | 2 +- packages/jest-test-sequencer/package.json | 2 +- packages/jest-transform/package.json | 2 +- packages/jest-types/package.json | 2 +- packages/jest-util/package.json | 2 +- packages/jest-validate/package.json | 2 +- packages/jest-watcher/package.json | 2 +- packages/jest-worker/package.json | 2 +- packages/jest/package.json | 2 +- packages/pretty-format/package.json | 2 +- packages/test-globals/package.json | 2 +- packages/test-utils/package.json | 2 +- 44 files changed, 44 insertions(+), 44 deletions(-) diff --git a/lerna.json b/lerna.json index aba8600d27c1..01b60b3b655c 100644 --- a/lerna.json +++ b/lerna.json @@ -8,5 +8,5 @@ "syncWorkspaceLock": true } }, - "version": "29.6.0" + "version": "29.6.1" } diff --git a/packages/babel-jest/package.json b/packages/babel-jest/package.json index 17e64e75eb45..59f22f246049 100644 --- a/packages/babel-jest/package.json +++ b/packages/babel-jest/package.json @@ -1,7 +1,7 @@ { "name": "babel-jest", "description": "Jest plugin to use babel for transformation.", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/expect-utils/package.json b/packages/expect-utils/package.json index e6eb5a655075..4ff2998811ab 100644 --- a/packages/expect-utils/package.json +++ b/packages/expect-utils/package.json @@ -1,6 +1,6 @@ { "name": "@jest/expect-utils", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/expect/package.json b/packages/expect/package.json index 478f318d2cda..7c4c29c0b625 100644 --- a/packages/expect/package.json +++ b/packages/expect/package.json @@ -1,6 +1,6 @@ { "name": "expect", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-circus/package.json b/packages/jest-circus/package.json index e2e9c7126604..7b6114d0b8f5 100644 --- a/packages/jest-circus/package.json +++ b/packages/jest-circus/package.json @@ -1,6 +1,6 @@ { "name": "jest-circus", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-cli/package.json b/packages/jest-cli/package.json index 1ca670265697..1c18051eebe4 100644 --- a/packages/jest-cli/package.json +++ b/packages/jest-cli/package.json @@ -1,7 +1,7 @@ { "name": "jest-cli", "description": "Delightful JavaScript Testing.", - "version": "29.6.0", + "version": "29.6.1", "main": "./build/index.js", "types": "./build/index.d.ts", "exports": { diff --git a/packages/jest-config/package.json b/packages/jest-config/package.json index 6e2c7309194e..69fa224f5f8e 100644 --- a/packages/jest-config/package.json +++ b/packages/jest-config/package.json @@ -1,6 +1,6 @@ { "name": "jest-config", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-console/package.json b/packages/jest-console/package.json index 291400f52aa1..ea2d4602e2bc 100644 --- a/packages/jest-console/package.json +++ b/packages/jest-console/package.json @@ -1,6 +1,6 @@ { "name": "@jest/console", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-core/package.json b/packages/jest-core/package.json index 8678fe0667e0..05df585f8b43 100644 --- a/packages/jest-core/package.json +++ b/packages/jest-core/package.json @@ -1,7 +1,7 @@ { "name": "@jest/core", "description": "Delightful JavaScript Testing.", - "version": "29.6.0", + "version": "29.6.1", "main": "./build/index.js", "types": "./build/index.d.ts", "exports": { diff --git a/packages/jest-create-cache-key-function/package.json b/packages/jest-create-cache-key-function/package.json index 9fb8591fd67f..ed4aba58a097 100644 --- a/packages/jest-create-cache-key-function/package.json +++ b/packages/jest-create-cache-key-function/package.json @@ -1,6 +1,6 @@ { "name": "@jest/create-cache-key-function", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-diff/package.json b/packages/jest-diff/package.json index 0086410cae82..e71792134a0d 100644 --- a/packages/jest-diff/package.json +++ b/packages/jest-diff/package.json @@ -1,6 +1,6 @@ { "name": "jest-diff", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-each/package.json b/packages/jest-each/package.json index f6c939fdceb1..ef4cb2954158 100644 --- a/packages/jest-each/package.json +++ b/packages/jest-each/package.json @@ -1,6 +1,6 @@ { "name": "jest-each", - "version": "29.6.0", + "version": "29.6.1", "description": "Parameterised tests for Jest", "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/packages/jest-environment-jsdom/package.json b/packages/jest-environment-jsdom/package.json index c2d7730ab1e9..4c7eb828237f 100644 --- a/packages/jest-environment-jsdom/package.json +++ b/packages/jest-environment-jsdom/package.json @@ -1,6 +1,6 @@ { "name": "jest-environment-jsdom", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-environment-node/package.json b/packages/jest-environment-node/package.json index 3bf7c4ab53df..86f5a5e59bc4 100644 --- a/packages/jest-environment-node/package.json +++ b/packages/jest-environment-node/package.json @@ -1,6 +1,6 @@ { "name": "jest-environment-node", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-environment/package.json b/packages/jest-environment/package.json index 1898467b4db9..3575407a0ea3 100644 --- a/packages/jest-environment/package.json +++ b/packages/jest-environment/package.json @@ -1,6 +1,6 @@ { "name": "@jest/environment", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-expect/package.json b/packages/jest-expect/package.json index 06609c478392..a4869a19a8ca 100644 --- a/packages/jest-expect/package.json +++ b/packages/jest-expect/package.json @@ -1,6 +1,6 @@ { "name": "@jest/expect", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-fake-timers/package.json b/packages/jest-fake-timers/package.json index 6ba82957bc03..13d3c1261498 100644 --- a/packages/jest-fake-timers/package.json +++ b/packages/jest-fake-timers/package.json @@ -1,6 +1,6 @@ { "name": "@jest/fake-timers", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-globals/package.json b/packages/jest-globals/package.json index cda810abf5b7..3c3308f31a99 100644 --- a/packages/jest-globals/package.json +++ b/packages/jest-globals/package.json @@ -1,6 +1,6 @@ { "name": "@jest/globals", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-haste-map/package.json b/packages/jest-haste-map/package.json index 575c4424a88b..871c781b4b44 100644 --- a/packages/jest-haste-map/package.json +++ b/packages/jest-haste-map/package.json @@ -1,6 +1,6 @@ { "name": "jest-haste-map", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-jasmine2/package.json b/packages/jest-jasmine2/package.json index fa2d17de1e42..f76ad8e42b0b 100644 --- a/packages/jest-jasmine2/package.json +++ b/packages/jest-jasmine2/package.json @@ -1,6 +1,6 @@ { "name": "jest-jasmine2", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-leak-detector/package.json b/packages/jest-leak-detector/package.json index 65b2890cad4a..81987ee51de2 100644 --- a/packages/jest-leak-detector/package.json +++ b/packages/jest-leak-detector/package.json @@ -1,6 +1,6 @@ { "name": "jest-leak-detector", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-matcher-utils/package.json b/packages/jest-matcher-utils/package.json index 523a63a88c16..bd84bdf4fdce 100644 --- a/packages/jest-matcher-utils/package.json +++ b/packages/jest-matcher-utils/package.json @@ -1,7 +1,7 @@ { "name": "jest-matcher-utils", "description": "A set of utility functions for expect and related packages", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-message-util/package.json b/packages/jest-message-util/package.json index aee457c1b527..32b783bd33ca 100644 --- a/packages/jest-message-util/package.json +++ b/packages/jest-message-util/package.json @@ -1,6 +1,6 @@ { "name": "jest-message-util", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-mock/package.json b/packages/jest-mock/package.json index 1038939ceaa2..bd42517c7b85 100644 --- a/packages/jest-mock/package.json +++ b/packages/jest-mock/package.json @@ -1,6 +1,6 @@ { "name": "jest-mock", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-phabricator/package.json b/packages/jest-phabricator/package.json index 0e54ba223106..0cec9a477a55 100644 --- a/packages/jest-phabricator/package.json +++ b/packages/jest-phabricator/package.json @@ -1,6 +1,6 @@ { "name": "jest-phabricator", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-repl/package.json b/packages/jest-repl/package.json index c86607745b75..7d6ee55981af 100644 --- a/packages/jest-repl/package.json +++ b/packages/jest-repl/package.json @@ -1,6 +1,6 @@ { "name": "jest-repl", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-reporters/package.json b/packages/jest-reporters/package.json index 0bf3e7ea26f1..d601d763fb7a 100644 --- a/packages/jest-reporters/package.json +++ b/packages/jest-reporters/package.json @@ -1,7 +1,7 @@ { "name": "@jest/reporters", "description": "Jest's reporters", - "version": "29.6.0", + "version": "29.6.1", "main": "./build/index.js", "types": "./build/index.d.ts", "exports": { diff --git a/packages/jest-resolve-dependencies/package.json b/packages/jest-resolve-dependencies/package.json index 1b1b54f57489..842b9407397e 100644 --- a/packages/jest-resolve-dependencies/package.json +++ b/packages/jest-resolve-dependencies/package.json @@ -1,6 +1,6 @@ { "name": "jest-resolve-dependencies", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-resolve/package.json b/packages/jest-resolve/package.json index 6ee2ca10855c..da20c3012c82 100644 --- a/packages/jest-resolve/package.json +++ b/packages/jest-resolve/package.json @@ -1,6 +1,6 @@ { "name": "jest-resolve", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-runner/package.json b/packages/jest-runner/package.json index c6c609c695e3..1676e4a89224 100644 --- a/packages/jest-runner/package.json +++ b/packages/jest-runner/package.json @@ -1,6 +1,6 @@ { "name": "jest-runner", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-runtime/package.json b/packages/jest-runtime/package.json index 28ea54d26d4f..47b81a7b4bdb 100644 --- a/packages/jest-runtime/package.json +++ b/packages/jest-runtime/package.json @@ -1,6 +1,6 @@ { "name": "jest-runtime", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-snapshot/package.json b/packages/jest-snapshot/package.json index 2241c74253a4..010459dbd2bc 100644 --- a/packages/jest-snapshot/package.json +++ b/packages/jest-snapshot/package.json @@ -1,6 +1,6 @@ { "name": "jest-snapshot", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-test-result/package.json b/packages/jest-test-result/package.json index 5701e1cdddb4..7c1eb82a8285 100644 --- a/packages/jest-test-result/package.json +++ b/packages/jest-test-result/package.json @@ -1,6 +1,6 @@ { "name": "@jest/test-result", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-test-sequencer/package.json b/packages/jest-test-sequencer/package.json index 213cac7b8d16..5580a87473ff 100644 --- a/packages/jest-test-sequencer/package.json +++ b/packages/jest-test-sequencer/package.json @@ -1,6 +1,6 @@ { "name": "@jest/test-sequencer", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-transform/package.json b/packages/jest-transform/package.json index 67836af2c532..4edf00264894 100644 --- a/packages/jest-transform/package.json +++ b/packages/jest-transform/package.json @@ -1,6 +1,6 @@ { "name": "@jest/transform", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-types/package.json b/packages/jest-types/package.json index 1cdc6d2cda29..c2d647296408 100644 --- a/packages/jest-types/package.json +++ b/packages/jest-types/package.json @@ -1,6 +1,6 @@ { "name": "@jest/types", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-util/package.json b/packages/jest-util/package.json index 7320cbf50c37..a612bb4eba33 100644 --- a/packages/jest-util/package.json +++ b/packages/jest-util/package.json @@ -1,6 +1,6 @@ { "name": "jest-util", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-validate/package.json b/packages/jest-validate/package.json index a7a32afdde87..62d68644f5da 100644 --- a/packages/jest-validate/package.json +++ b/packages/jest-validate/package.json @@ -1,6 +1,6 @@ { "name": "jest-validate", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-watcher/package.json b/packages/jest-watcher/package.json index ef61ca366e8f..c1ccb24158d9 100644 --- a/packages/jest-watcher/package.json +++ b/packages/jest-watcher/package.json @@ -1,7 +1,7 @@ { "name": "jest-watcher", "description": "Delightful JavaScript Testing.", - "version": "29.6.0", + "version": "29.6.1", "main": "./build/index.js", "types": "./build/index.d.ts", "exports": { diff --git a/packages/jest-worker/package.json b/packages/jest-worker/package.json index 2df4a89306ee..5b821ad73129 100644 --- a/packages/jest-worker/package.json +++ b/packages/jest-worker/package.json @@ -1,6 +1,6 @@ { "name": "jest-worker", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest/package.json b/packages/jest/package.json index afca6d30637c..935fb3708198 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -1,7 +1,7 @@ { "name": "jest", "description": "Delightful JavaScript Testing.", - "version": "29.6.0", + "version": "29.6.1", "main": "./build/index.js", "types": "./build/index.d.ts", "exports": { diff --git a/packages/pretty-format/package.json b/packages/pretty-format/package.json index 7d0ea6bf2eb7..49716bb3007c 100644 --- a/packages/pretty-format/package.json +++ b/packages/pretty-format/package.json @@ -1,6 +1,6 @@ { "name": "pretty-format", - "version": "29.6.0", + "version": "29.6.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/test-globals/package.json b/packages/test-globals/package.json index 5daf069194f6..ab204c218276 100644 --- a/packages/test-globals/package.json +++ b/packages/test-globals/package.json @@ -1,6 +1,6 @@ { "name": "@jest/test-globals", - "version": "29.6.0", + "version": "29.6.1", "private": true, "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 9552c93b91c5..814ed73dffec 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@jest/test-utils", - "version": "29.6.0", + "version": "29.6.1", "private": true, "main": "./build/index.js", "types": "./build/index.d.ts",