Simen Bekkhus

Results 1232 comments of Simen Bekkhus

Yes, as mentioned this will only work if you don't use the `jest` object. Mocks are also probably broken, haven't tested them 😃

You need to run node with `--experimental-vm-modules` and either name you file `.mjs` or `"type": "module"` in `package.json`. EDIT: You probably have the latter seeing as it works outside of...

Yeah, from the OP >Please note that Jest will use the `vm` API (https://nodejs.org/api/vm.html) and as of writing (node v13.6) the ESM parts of this API is still flagged (`--experimental-vm-modules`)....

Thanks @aldeed! I'll look into issue 1, that indeed looks like a bug. EDIT: Should be fixed via #9850 Issue 2 needs node 12.16.0: https://nodejs.org/docs/latest-v12.x/api/vm.html#vm_class_vm_syntheticmodule I'll change the check in...

Thanks @beejunk! I've been wondering if there could be race conditions between `import`s that import the same module before it's fully linked. It _seems_ like that's what your hitting here....

@dandv You're essentially hitting this case: https://github.com/facebook/jest/pull/9772/files#r407255029 Could you open up a separate issue? Will need to figure out what to do with non-js extensions

@aldeed @beejunk 25.5.0 has been released with fixes for your issues. Keep the bug reports coming 😀

Oh, additionally it includes support for `import { jest } from '@jest/globals'` for those of you waiting for that 👍

Thanks for the report @beejunk. #6282 is supposed to deal with this, but that also wants to pass the query to transformers and stuff, that we don't need here. So...

@beejunk query thing fixed in 25.5.1. I haven't had time to investigate the other issue yet