mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
docs: update vitest config to match vitest docs (#3037)
* Update testing.md in vite, mergeConfig accepts only config in object form. If you have a config in callback form, you should call it before passing into mergeConfig. You can use the defineConfig helper to merge a config in callback form with another config: https://vite.dev/guide/api-javascript.html#mergeconfig * Fix formatting --------- Co-authored-by: Danilo Britto <dbritto.dev@gmail.com>
This commit is contained in:
parent
979ce7de92
commit
a90981afb5
@ -274,15 +274,17 @@ vi.mock('zustand') // to make it work like Jest (auto-mocking)
|
|||||||
import { defineConfig, mergeConfig } from 'vitest/config'
|
import { defineConfig, mergeConfig } from 'vitest/config'
|
||||||
import viteConfig from './vite.config'
|
import viteConfig from './vite.config'
|
||||||
|
|
||||||
export default mergeConfig(
|
export default defineConfig((configEnv) =>
|
||||||
viteConfig,
|
mergeConfig(
|
||||||
defineConfig({
|
viteConfig(configEnv),
|
||||||
test: {
|
defineConfig({
|
||||||
globals: true,
|
test: {
|
||||||
environment: 'jsdom',
|
globals: true,
|
||||||
setupFiles: ['./setup-vitest.ts'],
|
environment: 'jsdom',
|
||||||
},
|
setupFiles: ['./setup-vitest.ts'],
|
||||||
}),
|
},
|
||||||
|
}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user