vue3-realworld-example-app icon indicating copy to clipboard operation
vue3-realworld-example-app copied to clipboard

[WIP] test: let's use vite-jest for testing

Open haoqunjiang opened this issue 3 years ago • 3 comments

First, thanks for the great example app!

I was developing vite-jest and used this repository as a real-world test case. Now after v0.1.3 all the current tests are passing. So I'm opening this PR in case you are interested in joining the experiment of this new vite-jest integration.

Main changes in this PR:

  • removed babel-jest, ts-jest in favor of vite-jest
  • a few refactors as all test specs are native ES modules now:
    • jest object is imported from @jest/globals
    • use jest.unstable_mockModule instead of jest.mock
  • added 3 @ts-expect-error comments to pass the git pre-commit hook. These type checkings seem to have been failing before my refactor.

The coverage report is not working at the moment, though.

haoqunjiang avatar Dec 07 '21 07:12 haoqunjiang

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mutoe/vue3-realworld-example-app/EGDdwLaVHXYH6AfyWMzzPFEe9z4W
✅ Preview: https://vue3-realworld-example-app-git-fork-sodatea-vite-jest-mutoe.vercel.app

vercel[bot] avatar Dec 07 '21 07:12 vercel[bot]

@sodatea Sounds great, bro. I don't know if you represent the official Vite, but before it is officially released (at least the beta), I think this can only be pending, or merged into a separate branch for tracking :)

mutoe avatar Dec 10 '21 11:12 mutoe

but before it is officially released (at least the beta), I think this can only be pending, or merged into a separate branch for tracking :)

Yeah, it makes sense. I'll ping you again when the package reaches beta.

haoqunjiang avatar Dec 13 '21 07:12 haoqunjiang

Hi @sodatea , after the release of Vitest version 1.0, this project has been migrated to Vitest. Also this PR has been too long, close it for now. Welcome to open it again if necessary :D

mutoe avatar Dec 11 '23 14:12 mutoe