forked from mathieudutour/github-tag-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
24 lines (23 loc) · 948 Bytes
/
vitest.config.ts
File metadata and controls
24 lines (23 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { defineConfig } from 'vitest/config';
// Minimal Vitest config. Vite's native ESM support and its Rollup-based
// module graph mean we do NOT need any of the Jest-era workarounds:
// * no `--experimental-vm-modules` / `ts-jest` + `useESM` dance
// * no `.js` extension stripping in `moduleNameMapper`
// * no hand-rolled mocks for `@semantic-release/*` — Vitest loads the
// real ESM packages directly
//
// For the few `node_modules` ESM packages whose frozen namespace blocks
// `vi.spyOn(core, ...)`, individual test files use
// `vi.mock('@actions/core', async (importOriginal) => ...)` with a
// factory that returns a mutable plain object. See tests/action.test.ts
// and tests/utils.test.ts for the canonical pattern.
export default defineConfig({
test: {
include: ['tests/**/*.test.ts'],
environment: 'node',
globals: false,
clearMocks: true,
restoreMocks: true,
testTimeout: 10_000,
},
});