Skip to content

Vitest

Terminal window
tinkerise add testing

The testing module checks for existing test setup by looking for:

  • Vitest config files: vitest.config.ts/js/mts/mjs
  • Jest config files: jest.config.js/ts/mjs/cjs
  • Installed vitest or jest dependencies

If any of these exist, the module is treated as already installed.

testing always standardizes on Vitest and performs all of the following:

  • Installs vitest as a dev dependency
  • Creates vitest.config.ts
  • Adds package scripts:
    • test: vitest
    • test:run: vitest run
  • Creates starter files:
    • tests/sum.ts
    • tests/sum.test.ts
  • vitest.config.ts includes test.include and test.exclude defaults
  • package.json gets/updates test and test:run scripts
  • tests/ gets a working function and test so bun run test works immediately

If vitest.config.*, jest.config.*, or test tooling already exists, detection reports the enhancement as installed. For file-write conflicts in interactive runs, tinkerise shows a diff and allows replace/skip decisions.