zustand/vitest.config.ts
Daishi Kato d57072caf5
update vitest (#2462)
* update vitest

* use resolve

* patch for older ts

* for older ts

* hack with any

* for other builds

* wip: for umd

* Revert "wip: for umd"

This reverts commit a5c0d6beaa80cbbdcad7961b77d593effd6a83c8.

* wip: esm

* wip: system

* Revert "wip: system"

This reverts commit aa919631a94a5b321fa9f2ec6c26b826c37ca3b0.

* wip: umd

* wip: hack cjs

* system cannot be tested
2024-04-06 20:48:21 +09:00

26 lines
700 B
TypeScript

import { resolve } from 'path'
// eslint-disable-next-line import/extensions
import { defineConfig } from 'vitest/config'
export default defineConfig({
resolve: {
alias: [
{ find: /^zustand$/, replacement: resolve('./src/index.ts') },
{ find: /^zustand(.*)$/, replacement: resolve('./src/$1.ts') },
],
},
test: {
name: 'zustand',
// Keeping globals to true triggers React Testing Library's auto cleanup
// https://vitest.dev/guide/migration.html
globals: true,
environment: 'jsdom',
dir: 'tests',
reporters: 'basic',
coverage: {
reporter: ['text', 'json', 'html', 'text-summary'],
reportsDirectory: './coverage/',
},
},
})