A vitest
vitest based test plugin for @procore/hammer test
CLI.
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
The plugin supports @procore/hammer
CLI options, such as:
--watch
--coverage
--silent
-
--ci
(forces Watch mode off, Coverage mode on)
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
There are two main ways of overriding the plugin configuration: partial and full.
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;
}
};
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.