You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not an issue, because the input was already wrong.
If you really want to workaround this, see #5151 (comment)
Note that this is not an official one, and it will break frequently.
jest not working with ESM is not an issue of swc. See jestjs/jest#9430
common js vs ESM behavior
Technically this can be workarounded by SWC by compiling in a wrong way.
But ESM is an established standard, and swc follows the specification. If you use ESM as input, swc will compile the code to behave in a way defined by the specification.
You may claim the official typescript compiler does not follow specification if module type is common js, but it's a bug of tsc. If you want behavior of common js, you can write a common js module instead.
This is not an issue, because the input was already wrong.
If you really want to workaround this, see #5151 (comment)
Note that this is not an official one, and it will break frequently.
jest
not working with ESM is not an issue of swc. See jestjs/jest#9430common js vs ESM behavior
Technically this can be workarounded by SWC by compiling in a wrong way.
But ESM is an established standard, and swc follows the specification. If you use ESM as input, swc will compile the code to behave in a way defined by the specification.
You may claim the official typescript compiler does not follow specification if module type is common js, but it's a bug of
tsc
. If you want behavior of common js, you can write a common js module instead.Discussions
Issues
Cannot redefine property
error when usingjest.spyOn
after v1.2.206 #5059The text was updated successfully, but these errors were encountered: