sucrase icon indicating copy to clipboard operation
sucrase copied to clipboard

jest.mock hoisting breaks when using @jest/globals

Open Smrtnyk opened this issue 8 months ago • 0 comments

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

Smrtnyk avatar Oct 19 '23 05:10 Smrtnyk