0.10.0 • Published 9 months ago
@procore/hammer-test-vitest v0.10.0
@procore/hammer-vitest-test
A vitest
vitest based test plugin for @procore/hammer test
CLI.
Quick Start
Install @procore/hammer
and @procore/hammer-test-vitest
.
yarn add -D @procore/hammer
yarn add -D @procore/hammer-test-vitest
Run @procore/hammer test
yarn @procore/hammer test
CLI Options
The plugin supports @procore/hammer
CLI options, such as:
--watch
--coverage
--silent
--ci
(forces Watch mode off, Coverage mode on)
Defaults
The plugin does provide a basic reasonable Vitest configuration.
The plugin detects a desired environment based on package's dependencies. For React-based projects it shall set
jsdom
environment, andnode
environment for others'src/**/vitest.setup.{ts,js,cjs,mjs}'
files will be automatically picked up and used as setup files
Overrides
There are two main ways of overriding the plugin configuration: partial and full.
Partial Override
To partially override the config, hammer
configuration file can be used:
// hammer.config.ts
export default {
testVitest(config) {
config.setupFiles = ["src/my-vitest-setup.js"];
return config;
}
};
Development
This project uses yarn
, and supports the following commands:
build
: builds and bundles the project.clean
: deletes the output directory and any built files.format
: runsprettier
on the project.format:check
: usesprettier
to validate code format.lint:code
: useseslint
to lint code.lint:types
: usesTypeScript
to validate types.test
: runs the unit test suite.test:ci
: run the unit test suite, reporting coverage.