Files
Nikos Baxevanis 482c195b0d refactor(pox-4-tests): Move PoX-4 stateful property-based tests
- Relocate PoX-4 stateful property-based tests from
  ../core-contract-tests/tests/pox-4/ to
  boot-contracts-stateful-prop-tests/tests/pox-4.
- Implement a minimalistic vitest and Clarinet project setup.
- Adjust configurations for optimal test isolation.
- Ensure Clarinet config is as minimalistic as possible.
- For more details, see: https://github.com/stacks-network/stacks-core/pull/4725#issuecomment-2082701083
2024-04-29 18:31:11 +02:00

44 lines
1.4 KiB
JavaScript

/// <reference types="vitest" />
import { defineConfig } from "vite";
import {
vitestSetupFilePath,
getClarinetVitestsArgv,
} from "@hirosystems/clarinet-sdk/vitest";
/*
In this file, Vitest is configured so that it works seamlessly with Clarinet and the Simnet.
The `vitest-environment-clarinet` will initialise the clarinet-sdk
and make the `simnet` object available globally in the test files.
`vitestSetupFilePath` points to a file in the `@hirosystems/clarinet-sdk` package that does two things:
- run `before` hooks to initialize the simnet and `after` hooks to collect costs and coverage reports.
- load custom vitest matchers to work with Clarity values (such as `expect(...).toBeUint()`)
The `getClarinetVitestsArgv()` will parse options passed to the command `vitest run --`
- vitest run -- --manifest ./Clarinet.toml # pass a custom path
- vitest run -- --coverage --costs # collect coverage and cost reports
*/
export default defineConfig({
test: {
environment: "clarinet", // use vitest-environment-clarinet
pool: "forks",
poolOptions: {
threads: { singleThread: true },
forks: { singleFork: true },
},
setupFiles: [
vitestSetupFilePath,
// custom setup files can be added here
],
environmentOptions: {
clarinet: {
...getClarinetVitestsArgv(),
// add or override options
},
},
},
});