Skip to content
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

Merged
merged 83 commits into from Jun 7, 2023
Merged

Conversation

Dunqing
Copy link
Contributor

@Dunqing Dunqing commented May 20, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

  • Replace jest with vitest
  • Replace jest-puppeteer with setupPuppeteer (Reference jest-puppeteer)
  • Alias */lib to */es (cannot mock commonjs, because the dependency of dependency cannot be processed via vitest)
  • Fixes SyntaxError: Unexpected token 'export' glennreyes/react-countup#805 (comment) (Fixed countup.js to 2.6.0)
  • Dropdown depends on fix(vite-node): circular import stuck vitest-dev/vitest#3418
  • closes vi.todo (failed tests)
    1. upload svg file with should not have CORS error (Fixed)
      Use image/svg instead of image/svg+xml
    2. test edge case when container is not windows (Fixed, The test is incorrect)
      I guess the test case itself is incorrect.
    3. Anchor correct render when the target is null (Fixed)
      resize-observer-polyfill cannot support the target is null

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 5b1a48f

The pull request updates the test files and mock files to use vitest instead of jest 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

@github-actions
Copy link
Contributor

github-actions bot commented May 20, 2023

@RedJue
Copy link
Member

RedJue commented May 20, 2023

CI 挂了

@github-actions
Copy link
Contributor

Hi @Dunqing. Thanks for your contribution. The path .github/ or scripts/ and CHANGELOG is only maintained by team members. This current PR will be closed and team members will help on this.

@afc163 afc163 reopened this May 21, 2023
@github-actions github-actions bot closed this May 21, 2023
@afc163 afc163 reopened this May 21, 2023
@Dunqing Dunqing requested a review from zombieJ June 2, 2023 02:24
@afc163
Copy link
Member

afc163 commented Jun 5, 2023

泰酷啦

Copy link
Contributor

@yoyo837 yoyo837 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

泰酷辣! 在明星PR下混个脸熟.

@socket-security
Copy link

New and updated dependency changes detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives1 Size Publisher
vitest 🆕 0.31.4 filesystem, shell, environment +2 1.47 MB oreanno
countup.js 🆕 2.6.0 None +0 96.3 kB inorganik

🚮 Removed packages: @types/jest-environment-puppeteer@5.0.3, jest-environment-jsdom@29.5.0, jest-puppeteer@9.0.0

Footnotes

  1. https://docs.socket.dev

package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
@afc163
Copy link
Member

afc163 commented Jun 7, 2023

图片

https://github.com/ant-design/ant-design/pull/42506/files 这里有一些提示信息。

@MadCcc MadCcc merged commit 6759887 into ant-design:master Jun 7, 2023
52 checks passed
"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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个为啥加回来了。。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MadCcc added a commit that referenced this pull request Jun 7, 2023
MadCcc added a commit that referenced this pull request Jun 7, 2023
Dunqing added a commit to Dunqing/ant-design that referenced this pull request Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants