Skip to content

Commit 496bd25

Browse files
authoredOct 3, 2024··
fix(vitest): deprecate UserConfig in favor of ViteUserConfig (#6626)
1 parent 970e0f4 commit 496bd25

8 files changed

+16
-8
lines changed
 

‎packages/vitest/src/public/config.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ export { mergeConfig } from 'vite'
1515
export { extraInlineDeps } from '../constants'
1616
export type { Plugin } from 'vite'
1717

18-
export type { ConfigEnv, ViteUserConfig as UserConfig }
18+
export type { ConfigEnv, ViteUserConfig }
19+
/**
20+
* @deprecated Use `ViteUserConfig` instead
21+
*/
22+
export type UserConfig = ViteUserConfig
1923
export type { UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, WorkspaceProjectConfiguration }
2024
export type UserConfigFnObject = (env: ConfigEnv) => ViteUserConfig
2125
export type UserConfigFnPromise = (env: ConfigEnv) => Promise<ViteUserConfig>

‎test/config/test/bail.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { type UserConfig, expect, test } from 'vitest'
1+
import { expect, test } from 'vitest'
22

3+
import type { UserConfig } from 'vitest/node'
34
import { runVitest } from '../../test-utils'
45

56
const configs: UserConfig[] = []

‎test/config/test/failures.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { beforeEach, expect, test } from 'vitest'
2-
import type { UserConfig } from 'vitest'
2+
import type { UserConfig } from 'vitest/node'
33
import { version } from 'vitest/package.json'
44

55
import { normalize, resolve } from 'pathe'

‎test/config/test/mixed-environments.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { type UserConfig, expect, test } from 'vitest'
1+
import { expect, test } from 'vitest'
2+
import type { UserConfig } from 'vitest/node'
23

34
import { runVitest } from '../../test-utils'
45

‎test/config/test/override.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { UserConfig } from 'vitest'
1+
import type { UserConfig } from 'vitest/node'
22
import type { UserConfig as ViteUserConfig } from 'vite'
33
import { describe, expect, it } from 'vitest'
44
import { createVitest, parseCLI } from 'vitest/node'

‎test/config/test/shard.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { type UserConfig, expect, test } from 'vitest'
1+
import { expect, test } from 'vitest'
22
import { basename } from 'pathe'
33

4+
import type { UserConfig } from 'vitest/node'
45
import * as testUtils from '../../test-utils'
56

67
function runVitest(config: UserConfig) {

‎test/config/test/shuffle-options.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { InlineConfig } from 'vitest'
1+
import type { InlineConfig } from 'vitest/node'
22
import { expect, test } from 'vitest'
33
import { runVitest } from '../../test-utils'
44

‎test/config/test/workers-option.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { type UserConfig, describe, expect, test, vi } from 'vitest'
1+
import { describe, expect, test, vi } from 'vitest'
2+
import type { UserConfig } from 'vitest/node'
23

34
import { getWorkersCountByPercentage } from 'vitest/src/utils/workers.js'
45
import * as testUtils from '../../test-utils'

0 commit comments

Comments
 (0)
Please sign in to comment.