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
importSetTestfrom'./../src/setTest';test('Test it works',()=>{constc=SetTest();expect(c).toBeInstanceOf(Set);});
run:
npx tsc npx jest
Expected behavior
Passing test
Actual behavior
Failing test:
FAIL tests/setTest.test.ts
× Test it works (1 ms)
● Test it works
TypeError: a.intersection is not a function
3 | const b = new Set([2, 3]);
4 |
> 5 | return a.intersection(b);
| ^
6 | };
at SetTest (src/setTest.ts:5:12)
at Object.<anonymous> (tests/setTest.test.ts:4:20)
However, code compiles fine.
Debug log
N/A
Additional context
Does ts-jest not just use the typescript version used in the project?
Environment
System:
OS: Windows 11 10.0.26100
CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700K
Binaries:
Node: 20.13.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
pnpm: 9.12.1 - ~\AppData\Roaming\npm\pnpm.CMD
npmPackages:
jest: ^29.7.0 => 29.7.0
Also fails under Ubuntu running in WSL
The text was updated successfully, but these errors were encountered:
Version
29.2.5
Steps to reproduce
Do the following:
npm init
npm install --save-dev jest typescript ts-jest @types/jest
npx ts-jest config:init
npx tsc --init
Then change tsconfig to add (leaving all other defaults):
Then create "src/setTest.ts":
and create "tests/setTest.test.ts":
run:
npx tsc
npx jest
Expected behavior
Passing test
Actual behavior
Failing test:
However, code compiles fine.
Debug log
N/A
Additional context
Does ts-jest not just use the typescript version used in the project?
Environment
The text was updated successfully, but these errors were encountered: