Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move config related methods to 'vitest/node' #765

Merged
merged 1 commit into from Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/config/index.md
Expand Up @@ -24,7 +24,7 @@ export default defineConfig({
You can retrieve Vitest's default options to expand them if needed:

```ts
import { defineConfig, configDefaults } from 'vitest'
import { defineConfig, configDefaults } from 'vitest/node'

export default defineConfig({
test: {
Expand Down
7 changes: 0 additions & 7 deletions packages/vitest/src/index.ts
@@ -1,4 +1,3 @@
import type { UserConfig } from 'vite'
import type { Plugin as PrettyFormatPlugin } from 'pretty-format'
import type { Any, Anything } from './integrations/chai/jest-asymmetric-matchers'
import type { MatcherState, MatchersObject } from './integrations/chai/types'
Expand All @@ -14,8 +13,6 @@ export * from './integrations/vi'
export * from './types'
export * from './api/types'

export { configDefaults } from './defaults'

type VitestInlineConfig = InlineConfig

declare module 'vite' {
Expand All @@ -27,10 +24,6 @@ declare module 'vite' {
}
}

export function defineConfig(config: UserConfig) {
return config
}

interface AsymmetricMatchersContaining {
stringContaining(expected: string): any
objectContaining(expected: any): any
Expand Down
7 changes: 7 additions & 0 deletions packages/vitest/src/node/index.ts
@@ -1,3 +1,10 @@
import type { UserConfig } from 'vite'

export { configDefaults } from '../defaults'
export function defineConfig(config: UserConfig) {
return config
}

export type { Vitest } from './core'
export { createVitest } from './create'
export { VitestPlugin } from './plugins'