esbuild-jest icon indicating copy to clipboard operation
esbuild-jest copied to clipboard

Can't use the world `Block` anywhere in test file

Open thdxr opened this issue 3 years ago • 6 comments

I was getting strange compilation errors in ESM and finally narrowed it down to my usage of the word Block anywhere in source code. This included comments, tried moving it around everywhere as well.

Eventually found this: https://github.com/aelbore/esbuild-jest/blob/master/src/index.ts#L33

So...guess that TODO has come home to roost

thdxr avatar Apr 02 '22 02:04 thdxr

I think I just hit this too. 😬

andrewbranch avatar Jun 18 '22 03:06 andrewbranch

I encountered the same issue with a function called clock.

axel-planfox avatar Jul 12 '22 11:07 axel-planfox

The problem is the word ock, it is parsed and interpreted somewhere.

sebastianrothe avatar Jul 28 '22 15:07 sebastianrothe

yep, see https://github.com/aelbore/esbuild-jest/pull/44#issuecomment-893481820

bhousel avatar Jul 28 '22 16:07 bhousel

Does anyone know the historical reason for this? What a stupid decision it seems now. It killed my whole day

gwsbhqt avatar Jun 30 '23 09:06 gwsbhqt

How does this issue exist, and how is it not even acknowledged? Is the esbuild-jest community just not using mocks? How did someone think https://github.com/aelbore/esbuild-jest/blob/master/src/index.ts#L33 was acceptable?

daveclay avatar Nov 02 '23 19:11 daveclay