@procore/hammer-test-vitest
v0.5.0
Published
Vitest Plugin for Hammer
Downloads
164
Maintainers
Keywords
Readme
@procore/hammer-vitest-test
A 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;
}
};
Full Override
To replace the plugin config entirely, any local Vitest configuration can be used - like vitest.config.ts
or any other Vitest supported way.
Refer to Configuring Vitest for details.