Skip to content

salazarr-js/vitest-learning-playground

Repository files navigation

Vitest Learning Playground

Note

This repository is for learning and experimenting with vitest

This is a demo project that showcases examples and serves as a guide to implement vitest with typescript.

References

Scripts

npm run test # Run all tests on watch mode
npm run test sum # Run a specific test

Used Vitest API

test/sum.test.ts

tests/merge.test.ts

tests/spying.test.ts

tests/mock.test.ts

Warning

Vitest will not mock modules that were imported inside a setup file because they are cached by the time a test file is running. You can call vi.resetModules() inside vi.hoisted to clear all module caches before running a test file.

https://vitest.dev/api/vi.html#vi-mock

tests/time.test.ts

tests/timer.test.ts

tests/network.test.ts

About

Vitest Learning Playground

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published