/create-vitest

A npx command to create and scaffold vite tests with best practices

Primary LanguageTypeScript

Create Vitest

A command line utility tool to generate a pre-configured vitest test (spec) file for a TypeScript file with best practices. Scaffold the test and mock all imports!


Features

  • A consistent approach to testing which works for any scenario
  • Mocks all dependencies (imports) of the file
  • Optionally override the mock with test specific mock
  • Best practice for test teardown
  • Best practice for test setup and scaffold
  • Easy to use beautiful CLI tool to guide you alone the way

Usage

Regular usage

$ npm create vitest

Or

$ npx create-vitest

Specifying a file

This is a short-cut, but otherwise it's the same as above. If the file name is not specified, it will be prompted.

$ npm create vitest <file-name>

Or

$ npx create-vitest <file-name>

Made with ❤️