vitest icon indicating copy to clipboard operation
vitest copied to clipboard

Comparison with SWC/jest

Open Silverium opened this issue 4 years ago • 2 comments

Clear and concise description of the problem

in comparisons page, I would like to see a comparison with https://www.npmjs.com/package/@swc/jest

Suggested solution

compare a set of tests with https://www.npmjs.com/package/@swc/jest

Alternative

No response

Additional context

No response

Validations

Silverium avatar Feb 15 '22 11:02 Silverium

Would like to know, if/how is it possible to use vitest with TypeScript support while using SWC for compiling a project.

Currently, I'm using jest and @swc/jest for testing my Node.js fastify API REST application but there are many issues with jest and vitest is really looking great and modern! Actually, jest is stopping my project to use ESM modules imports "type": "module" in my package.json. vitest seems to solve this issue (and of course with many other great improvements). Is it possible/recommended to use vitest without vite and not for frontend but for backend code? How can I use SWC for compiling my project, but still configure vitest for testing, and is it viable/good to do so?

Thanks for your replies! :smile:

theoludwig avatar Feb 21 '22 21:02 theoludwig

You can use Vite plugins to compile your project, like this: https://github.com/wight554/vitest-nestjs-testing/commit/9e4d1e5f6c4b723b972aa470aed2ef3d3986476e (haven't tested it)

sheremet-va avatar Feb 22 '22 04:02 sheremet-va

I don't think this comparison is needed in documentation because you can also use SWC transformer in Vitest, so comparing Vitest and Jest is enough.

sheremet-va avatar Feb 12 '24 09:02 sheremet-va