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

Refactor(test): update vitest settings #1851

Merged
merged 4 commits into from
Dec 25, 2023

Conversation

watany-dev
Copy link
Contributor

@watany-dev watany-dev commented Dec 24, 2023

I have made these settings.

1. Handling Vitest's type checking. This makes tsc --no-emit unnecessary.
https://vitest.dev/config/#typecheck

2. I don't think the Vitest configuration file is needed in tsconfig.build. I have listed similar items that I think are unnecessary, but please point out if I am mistaken.
3. Update from Vitest 1.04 to 1.10.

Author should do the followings, if applicable

  • Add tests
  • Run tests
  • yarn denoify to generate files for Deno

@yusukebe
Copy link
Member

Hi @watany-dev

Thanks!

I've tried Vite's type checking before, but it did not work well, and also, with this PR, it doesn't catch the type errors.

Screenshot 2023-12-24 at 15 52 19

I don't know if this setting is right or not. Anyway, if it can not check types, we have to keep using tsc.

@watany-dev watany-dev force-pushed the refactor-vitest-settings branch from 1d6f7cf to 0acc04a Compare December 25, 2023 02:17
@watany-dev
Copy link
Contributor Author

watany-dev commented Dec 25, 2023

@yusukebe
Thank you for the review. Upon rechecking the typecheck tests for Vitest, it appears that '*.test-d.ts' is the scope, and it's not a complete substitute for tsc. I have reverted the changes.
https://vitest.dev/guide/testing-types.html#testing-types

@yusukebe
Copy link
Member

yusukebe commented Dec 25, 2023

  1. I don't think the Vitest configuration file is needed in tsconfig.build. I have listed similar items that I think are unnecessary, but please point out if I am mistaken.

We don't have to modify tsconfig.build.json because it is just for the build phase used in build.ts. Vitest uses tsconfig.json.

@watany-dev

Sorry! I've misunderstood! It looks good!

@yusukebe
Copy link
Member

@watany-dev

Thanks. We can merge this!

@yusukebe yusukebe merged commit 7f0e51a into honojs:main Dec 25, 2023
@watany-dev watany-dev deleted the refactor-vitest-settings branch December 25, 2023 02:59
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.

2 participants