Skip to content

fix: handle imports after teardown same as require - #16080

Merged
SimenB merged 9 commits into
jestjs:mainfrom
SimenB:import-after-teardown
May 2, 2026
Merged

fix: handle imports after teardown same as require#16080
SimenB merged 9 commits into
jestjs:mainfrom
SimenB:import-after-teardown

Conversation

@SimenB

@SimenB SimenB commented May 1, 2026

Copy link
Copy Markdown
Member

Summary

#15951 made me realize we don't have the same error for import as require.

Needed another boolean, so refactored to a state union

Test plan

Tests added.

Copilot AI review requested due to automatic review settings May 1, 2026 21:27
@netlify

netlify Bot commented May 1, 2026

Copy link
Copy Markdown

Deploy Preview for jestjs ready!

Name Link
🔨 Latest commit 1627adf
🔍 Latest deploy log https://app.netlify.com/projects/jestjs/deploys/69f5af33678d980007785420
😎 Deploy Preview https://deploy-preview-16080--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented May 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

babel-jest

npm i https://pkg.pr.new/babel-jest@16080

babel-plugin-jest-hoist

npm i https://pkg.pr.new/babel-plugin-jest-hoist@16080

babel-preset-jest

npm i https://pkg.pr.new/babel-preset-jest@16080

create-jest

npm i https://pkg.pr.new/create-jest@16080

@jest/diff-sequences

npm i https://pkg.pr.new/@jest/diff-sequences@16080

expect

npm i https://pkg.pr.new/expect@16080

@jest/expect-utils

npm i https://pkg.pr.new/@jest/expect-utils@16080

jest

npm i https://pkg.pr.new/jest@16080

jest-changed-files

npm i https://pkg.pr.new/jest-changed-files@16080

jest-circus

npm i https://pkg.pr.new/jest-circus@16080

jest-cli

npm i https://pkg.pr.new/jest-cli@16080

jest-config

npm i https://pkg.pr.new/jest-config@16080

@jest/console

npm i https://pkg.pr.new/@jest/console@16080

@jest/core

npm i https://pkg.pr.new/@jest/core@16080

@jest/create-cache-key-function

npm i https://pkg.pr.new/@jest/create-cache-key-function@16080

jest-diff

npm i https://pkg.pr.new/jest-diff@16080

jest-docblock

npm i https://pkg.pr.new/jest-docblock@16080

jest-each

npm i https://pkg.pr.new/jest-each@16080

@jest/environment

npm i https://pkg.pr.new/@jest/environment@16080

jest-environment-jsdom

npm i https://pkg.pr.new/jest-environment-jsdom@16080

@jest/environment-jsdom-abstract

npm i https://pkg.pr.new/@jest/environment-jsdom-abstract@16080

jest-environment-node

npm i https://pkg.pr.new/jest-environment-node@16080

@jest/expect

npm i https://pkg.pr.new/@jest/expect@16080

@jest/fake-timers

npm i https://pkg.pr.new/@jest/fake-timers@16080

@jest/get-type

npm i https://pkg.pr.new/@jest/get-type@16080

@jest/globals

npm i https://pkg.pr.new/@jest/globals@16080

jest-haste-map

npm i https://pkg.pr.new/jest-haste-map@16080

jest-jasmine2

npm i https://pkg.pr.new/jest-jasmine2@16080

jest-leak-detector

npm i https://pkg.pr.new/jest-leak-detector@16080

jest-matcher-utils

npm i https://pkg.pr.new/jest-matcher-utils@16080

jest-message-util

npm i https://pkg.pr.new/jest-message-util@16080

jest-mock

npm i https://pkg.pr.new/jest-mock@16080

@jest/pattern

npm i https://pkg.pr.new/@jest/pattern@16080

jest-phabricator

npm i https://pkg.pr.new/jest-phabricator@16080

jest-regex-util

npm i https://pkg.pr.new/jest-regex-util@16080

@jest/reporters

npm i https://pkg.pr.new/@jest/reporters@16080

jest-resolve

npm i https://pkg.pr.new/jest-resolve@16080

jest-resolve-dependencies

npm i https://pkg.pr.new/jest-resolve-dependencies@16080

jest-runner

npm i https://pkg.pr.new/jest-runner@16080

jest-runtime

npm i https://pkg.pr.new/jest-runtime@16080

@jest/schemas

npm i https://pkg.pr.new/@jest/schemas@16080

jest-snapshot

npm i https://pkg.pr.new/jest-snapshot@16080

@jest/snapshot-utils

npm i https://pkg.pr.new/@jest/snapshot-utils@16080

@jest/source-map

npm i https://pkg.pr.new/@jest/source-map@16080

@jest/test-result

npm i https://pkg.pr.new/@jest/test-result@16080

@jest/test-sequencer

npm i https://pkg.pr.new/@jest/test-sequencer@16080

@jest/transform

npm i https://pkg.pr.new/@jest/transform@16080

@jest/types

npm i https://pkg.pr.new/@jest/types@16080

jest-util

npm i https://pkg.pr.new/jest-util@16080

jest-validate

npm i https://pkg.pr.new/jest-validate@16080

jest-watcher

npm i https://pkg.pr.new/jest-watcher@16080

jest-worker

npm i https://pkg.pr.new/jest-worker@16080

pretty-format

npm i https://pkg.pr.new/pretty-format@16080

commit: 1627adf