[X] This is the appropriate issue form for the tooling issue I would like to report.
Expected
I expected the tests to run and fail when I ran npm run test -- 1.
Actual
I received this error:
FAIL 01-syntactic-sugar/index.test.js
● Test suite failed to run
TypeError: Cannot assign to read only property 'performance' of object '[object global]'
at hijackMethod (../../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:946:32)
at Object.install (../../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1733:17)
at FakeTimers.useFakeTimers (../../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36)
After changing enableGlobally from true to false, my tests failed the way I expected them to. I then fixed the obvious issues in my code and the tests passed.
Additional Info
I'm not really sure how to document this finding. Again, it should only affect users with node v19. I didn't try this out, but it was recommended in a post.
👋 thanks for filing this @rogue0137! This is new - and looks like perhaps a result of https://github.com/sinonjs/fake-timers/issues/441? Updating jest and ts-jest to their latest versions seems to fix it.
Tooling Report Checklist
main
branch of the repository.Expected
I expected the tests to run and fail when I ran
npm run test -- 1
.Actual
I received this error:
So I went into
jest.config.js
.The original file is:
I changed it to:
After changing enableGlobally from true to false, my tests failed the way I expected them to. I then fixed the obvious issues in my code and the tests passed.
Additional Info
I'm not really sure how to document this finding. Again, it should only affect users with node v19. I didn't try this out, but it was recommended in a post.
My node version is v19.9.0.