sucrase
sucrase copied to clipboard
jest.mock hoisting breaks when using @jest/globals
It looks like jest.mock hoisting breaks as soon as jest is imported from @jest/globals import {jest} from "@jest/globals"; import {foo} from './module1.js'; import {bar} from './module2.js';
jest.mock('./module1.js');
test fails, but if you remove jest import than jest.mock works fine I assume jest.mock should be hoisted under import of jest/globals or jest/globals should be removed as an import since it should only provide types