Skip to content

Commit ce418c5

Browse files
authored
fix: move config related methods to 'vitest/node' (#765)
1 parent 18cc578 commit ce418c5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

docs/config/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default defineConfig({
2424
You can retrieve Vitest's default options to expand them if needed:
2525

2626
```ts
27-
import { defineConfig, configDefaults } from 'vitest'
27+
import { defineConfig, configDefaults } from 'vitest/node'
2828

2929
export default defineConfig({
3030
test: {

packages/vitest/src/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { UserConfig } from 'vite'
21
import type { Plugin as PrettyFormatPlugin } from 'pretty-format'
32
import type { Any, Anything } from './integrations/chai/jest-asymmetric-matchers'
43
import type { MatcherState, MatchersObject } from './integrations/chai/types'
@@ -14,8 +13,6 @@ export * from './integrations/vi'
1413
export * from './types'
1514
export * from './api/types'
1615

17-
export { configDefaults } from './defaults'
18-
1916
type VitestInlineConfig = InlineConfig
2017

2118
declare module 'vite' {
@@ -27,10 +24,6 @@ declare module 'vite' {
2724
}
2825
}
2926

30-
export function defineConfig(config: UserConfig) {
31-
return config
32-
}
33-
3427
interface AsymmetricMatchersContaining {
3528
stringContaining(expected: string): any
3629
objectContaining(expected: any): any

packages/vitest/src/node/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
import type { UserConfig } from 'vite'
2+
3+
export { configDefaults } from '../defaults'
4+
export function defineConfig(config: UserConfig) {
5+
return config
6+
}
7+
18
export type { Vitest } from './core'
29
export { createVitest } from './create'
310
export { VitestPlugin } from './plugins'

0 commit comments

Comments
 (0)