Skip to content

Commit

Permalink
fix(vitest): deprecate UserConfig in favor of ViteUserConfig (#6626)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Oct 3, 2024
1 parent 970e0f4 commit 496bd25
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 8 deletions.
6 changes: 5 additions & 1 deletion packages/vitest/src/public/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export { mergeConfig } from 'vite'
export { extraInlineDeps } from '../constants'
export type { Plugin } from 'vite'

export type { ConfigEnv, ViteUserConfig as UserConfig }
export type { ConfigEnv, ViteUserConfig }
/**
* @deprecated Use `ViteUserConfig` instead
*/
export type UserConfig = ViteUserConfig
export type { UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, WorkspaceProjectConfiguration }
export type UserConfigFnObject = (env: ConfigEnv) => ViteUserConfig
export type UserConfigFnPromise = (env: ConfigEnv) => Promise<ViteUserConfig>
Expand Down
3 changes: 2 additions & 1 deletion test/config/test/bail.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type UserConfig, expect, test } from 'vitest'
import { expect, test } from 'vitest'

import type { UserConfig } from 'vitest/node'
import { runVitest } from '../../test-utils'

const configs: UserConfig[] = []
Expand Down
2 changes: 1 addition & 1 deletion test/config/test/failures.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { beforeEach, expect, test } from 'vitest'
import type { UserConfig } from 'vitest'
import type { UserConfig } from 'vitest/node'
import { version } from 'vitest/package.json'

import { normalize, resolve } from 'pathe'
Expand Down
3 changes: 2 additions & 1 deletion test/config/test/mixed-environments.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type UserConfig, expect, test } from 'vitest'
import { expect, test } from 'vitest'
import type { UserConfig } from 'vitest/node'

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

Expand Down
2 changes: 1 addition & 1 deletion test/config/test/override.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UserConfig } from 'vitest'
import type { UserConfig } from 'vitest/node'
import type { UserConfig as ViteUserConfig } from 'vite'
import { describe, expect, it } from 'vitest'
import { createVitest, parseCLI } from 'vitest/node'
Expand Down
3 changes: 2 additions & 1 deletion test/config/test/shard.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type UserConfig, expect, test } from 'vitest'
import { expect, test } from 'vitest'
import { basename } from 'pathe'

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

function runVitest(config: UserConfig) {
Expand Down
2 changes: 1 addition & 1 deletion test/config/test/shuffle-options.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { InlineConfig } from 'vitest'
import type { InlineConfig } from 'vitest/node'
import { expect, test } from 'vitest'
import { runVitest } from '../../test-utils'

Expand Down
3 changes: 2 additions & 1 deletion test/config/test/workers-option.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type UserConfig, describe, expect, test, vi } from 'vitest'
import { describe, expect, test, vi } from 'vitest'
import type { UserConfig } from 'vitest/node'

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

0 comments on commit 496bd25

Please sign in to comment.