0.10.0 • Published 1 year ago
@procore/hammer-test-vitest v0.10.0
@procore/hammer-vitest-test
A vitestvitest 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-vitestRun @procore/hammer test
yarn @procore/hammer testCLI 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
jsdomenvironment, andnodeenvironment 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: runsprettieron the project.format:check: usesprettierto validate code format.lint:code: useseslintto lint code.lint:types: usesTypeScriptto validate types.test: runs the unit test suite.test:ci: run the unit test suite, reporting coverage.