Open Haroenv opened 3 years ago
That's... odd. Any chance you could make a reduced reproduction so I can hack on it?
haven't yet made a smaller reproduction, but our code is open source: https://github.com/algolia/instantsearch.js/tree/poc/esbuild-jest
I think the tests which fail use require.requireActual
or jest.requireActual
like here:
when I comment out the requireActual the test only fails where I call .mockClear
odder and odder. I'll try to reproduce this locally
oh hmm ok this actually makes sense, since when it hoists, jest
goes out of scope of the import call. I wonder how this is solved with actual babel. I'll give it a look later this evening
Hi and thanks for this awesome initiative π.
You might already be aware of this other project which might actually be facing the same issue https://github.com/aelbore/esbuild-jest.
If not, the interesting part (also visible via the readme) is this related issue https://github.com/aelbore/esbuild-jest/issues/12.
Hope it help βΊοΈ.
this didn't happen in every test, and on different spots in the code, some describe, some expect, some an unrelated code point