-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(): Update canvas and jsdom #10417
base: master
Are you sure you want to change the base?
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
Build Stats
|
import { ModuleMocker } from 'jest-mock'; | ||
import { installCommonGlobals } from 'jest-util'; | ||
|
||
// The `Window` interface does not have an `Error.stackTraceLimit` property, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered on moving to vitest for unit tests and executing tests in real browser?
that way you can use real canvas for testing and not fake jsdom one
https://vitest.dev/guide/browser/
vitest has jest compatible API so I guess it wouldn't be that much work migrating unit tests
btw jest isn't seeing much love lately, it is barely maintained and I am questioning its future to be honest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that 70% of our unit tests are still on QUnit.
Then we have playwright.
Ideally unit tests won't run in the browser and will just test the fabricJS code and not require a real canvas, but just a mocked one.
Visual tests will run both in the browser and node throught playwright and would be based on browser or JSDOM + canvas and test also output of the canvas.
Vitest should be api compatibile with jest, and easy replacement, but before doing anything like that i would like to see qunit replaced.
So what we have now is a middle ground because there is no firepower to rewrite all the unit tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear if you want to open a PR to swap jest with vitest and and have it running in node only for now, you are welcome to do so, as long as it can support canvas with JSDOM is all good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear if you want to open a PR to swap jest with vitest and and have it running in node only for now, you are welcome to do so, as long as it can support canvas with JSDOM is all good
I am interested in this so will have a look at this on the weekend
This requires bumping up node from 16 to 18, meaning fabric 7.0 which sound painful as of today for me |
maybe i should call it 7.0 and move on, who cares. |
Description
The main update here is canvas 3.x hopefully is easier to handle in the cd/ci