I ran into a very strange error that took me a while to narrow down, but I finally figured out it's @swc/jest (or @swc/core) failing to handle the new satisfies keyword in TypeScript 4.9.
In short, the bug is that values imported from other modules are not found by swc when they are referenced inside of an object that has the satisfies operator. It's as if the object becomes a scope that is not able to access the imported values. Values in the same module can be referenced, however.
I ran into a very strange error that took me a while to narrow down, but I finally figured out it's
@swc/jest
(or@swc/core
) failing to handle the newsatisfies
keyword in TypeScript 4.9.In short, the bug is that values imported from other modules are not found by
swc
when they are referenced inside of an object that has thesatisfies
operator. It's as if the object becomes a scope that is not able to access the imported values. Values in the same module can be referenced, however.I made a repro here: https://github.com/blixt/test-swc-jest-bug (run
yarn && yarn jest
to see the error)