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(vitest): deprecate UserConfig in favor of ViteUserConfig #6626

Merged
merged 5 commits into from
Oct 3, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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