-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
refactor(tests): move canvas tests from qunit to vitest #10499
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
refactor(tests): move canvas tests from qunit to vitest #10499
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
3aa37df
to
fbb4289
Compare
|
||
vi.mock('../util/misc/objectEnlive', async (importOriginal) => ({ | ||
...(await importOriginal()), | ||
loadImage: vi.fn().mockImplementation(() => { |
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.
one test was loading the image in qunit, and it wasn't working in vitest like this since this is running in jsdom
so I did it like this
we can restore real image load if we eventually move to browser tests in vitest, but for now I think this is good enough
}), | ||
})); | ||
|
||
const EMPTY_JSON = '{"version":"' + version + '","objects":[]}'; |
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.
there are lots of tests here now
it got a lot
maybe it will be worth splitting these tests up
but for now I think this is ok, and we should focus first on finishing migration before thinking to refine this further
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.
I noticed that previous tests here were using test
instead of it
but on other places it
is used so there is a bit of mixup
I think we should unify this to only use one approach
most of tests are using it
so I guess it would make sense to use it
in all files then
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.
i have no preferences.
I always used 'it' at work, recently they told me that 'test' should be preferred.
I do not even know if they are aliases or have slight differences
Build Stats
|
|
moves canvas tests from qunit to vitest
this one is pretty big one, and I think most complicated one
other ones will be much or should be much easier, at least according to my cursory look over it