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: migrate to vitest #42506
chore: migrate to vitest #42506
Conversation
CI 挂了 |
Hi @Dunqing. Thanks for your contribution. The path |
泰酷啦 |
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.
泰酷辣! 在明星PR下混个脸熟.
New and updated dependency changes detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: @types/jest-environment-puppeteer@5.0.3, jest-environment-jsdom@29.5.0, jest-puppeteer@9.0.0 Footnotes |
"antd-img-crop": "^4.9.0", | ||
"antd-style": "^3.0.0", | ||
"antd-token-previewer": "^1.1.0-21", | ||
"chalk": "^4.0.0", | ||
"cheerio": "1.0.0-rc.12", | ||
"countup.js": "2.6.0", |
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 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.
2.6.0后有问题,glennreyes/react-countup#805 (comment)
…ign#42900)" This reverts commit 7322aa6.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
jest
withvitest
jest-puppeteer
withsetupPuppeteer
(Referencejest-puppeteer
)vi.todo
(failed tests)Use
image/svg
instead ofimage/svg+xml
I guess the test case itself is incorrect.
resize-observer-polyfill
cannot support the target is null📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 5b1a48f
The pull request updates the test files and mock files to use
vitest
instead ofjest
as the testing framework. It also fixes some import paths, linting errors, and test logic issues. The main purpose is to improve the test performance, compatibility, and consistency.🔍 Walkthrough
🤖 Generated by Copilot at 5b1a48f
jest
withvitest
for mocking and testing utilities (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link)es
instead oflib
for consistency withvitest
(link,link,link,link,link)async
keyword and useawait import
for dynamic imports with ES modules (link,link,link)default
property to match the original module exports (link,link)globalThis
instead ofglobal
to access the global object in a browser-compatible way (link)vi.importActual
instead ofjest.requireActual
to import the original module without mocking (link)vi.resetModules
instead ofjest.resetModules
to reset the module registry before each test (link)vi.spyOn
instead ofjest.spyOn
to spy on methods and check for console errors or warnings (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link)vi.fn
instead ofjest.fn
to create mock functions for props or variables (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link)vi.useFakeTimers
andvi.useRealTimers
instead ofjest.useFakeTimers
andjest.useRealTimers
to control the timer functions (link,link,link,link,link,link)vi.clearAllTimers
instead ofjest.clearAllTimers
to clear all the pending timer callbacks (link,link,link,link)vi.advanceTimersByTime
instead ofjest.advanceTimersByTime
to advance the timers by a given amount of milliseconds (link)vi.runAllTimers
instead ofjest.runAllTimers
to advance all the pending timer callbacks (link,link)act
calls sincewaitFakeTimer
already wraps the timer advancement inact
(link,link,link)classList.contains
instead ofclassList
to check for the active class name (link,link)Anchor.Link
withhref
as pending withit.todo
since it is not implemented yet (link)