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

Use Vitest instead of Mocha #793

Merged
merged 4 commits into from
Apr 2, 2024
Merged

Use Vitest instead of Mocha #793

merged 4 commits into from
Apr 2, 2024

Conversation

Yang-33
Copy link
Contributor

@Yang-33 Yang-33 commented Apr 1, 2024

When line-bot-sdk-nodejs supports ESM, we will use ESM code for testing. Vitest supports ESM+Typescript. This change will switch from using mocha to using vitest.

Also, along with mocha, nyc will be removed from dependencies because vitest supports coverage as well.

About the workaround:

  1. Running vitest 1.4.0 results in TypeScript errors due to an issue with vite, which vitest uses. The latest version of vite has fixed this, so I explicitly added the latest vite to the dev dependencies.
  2. Running vite for CJS leads to TypeScript errors due to an issue with rollup, which vite uses. There is no good workaround for CJS. I resolved this by rewriting node_modules as a workaround. There are no problems using vitest(?)

Base automatically changed from 01-stop-reading-package-json-in-code to master April 2, 2024 00:30
@Yang-33 Yang-33 marked this pull request as ready for review April 2, 2024 00:30
@Yang-33
Copy link
Contributor Author

Yang-33 commented Apr 2, 2024

@Yang-33 Yang-33 merged commit 67122af into master Apr 2, 2024
5 checks passed
@Yang-33 Yang-33 deleted the 01-02-use-vitest branch April 2, 2024 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants