Skip to content

Commit 1cf5c78

Browse files
authored
chore: remove vitest global options (vitejs#9620)
1 parent b1bbc5b commit 1cf5c78

File tree

66 files changed

+64
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+64
-9
lines changed

playground/assets/__tests__/relative-base/relative-base-assets.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, test } from 'vitest'
1+
import { beforeAll, describe, expect, test } from 'vitest'
22
import {
33
browserLogs,
44
findAssetFile,

playground/assets/__tests__/runtime-base/runtime-base-assets.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, test } from 'vitest'
1+
import { beforeAll, describe, expect, test } from 'vitest'
22
import {
33
browserLogs,
44
findAssetFile,

playground/backend-integration/__tests__/backend-integration.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import {
23
browserErrors,
34
browserLogs,

playground/build-old/__tests__/build-old.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, test } from 'vitest'
1+
import { describe, expect, test } from 'vitest'
22
import { page } from '~utils'
33

44
describe('syntax preserve', () => {

playground/cli-module/__tests__/cli-module.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { port } from './serve'
23
import { page } from '~utils'
34

playground/cli/__tests__/cli.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { port } from './serve'
23
import { page } from '~utils'
34

playground/css-codesplit-cjs/__tests__/css-codesplit.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import { findAssetFile, getColor, isBuild, readManifest } from '~utils'
23

34
test('should load both stylesheets', async () => {

playground/css-codesplit/__tests__/css-codesplit.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import { findAssetFile, getColor, isBuild, page, readManifest } from '~utils'
23

34
test('should load all stylesheets', async () => {

playground/css-sourcemap/__tests__/css-sourcemap.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { URL } from 'node:url'
2+
import { describe, expect, test } from 'vitest'
23
import {
34
extractSourcemap,
45
formatSourcemapForSnapshot,

playground/css/__tests__/css.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { readFileSync } from 'node:fs'
2+
import { expect, test } from 'vitest'
23
import {
34
editFile,
45
findAssetFile,

playground/css/__tests__/postcss-plugins-different-dir/postcss-plugins-different-dir.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'node:path'
22
import { createServer } from 'vite'
3+
import { expect, test } from 'vitest'
34
import { getBgColor, getColor, page, ports } from '~utils'
45

56
// Regression test for https://github.com/vitejs/vite/issues/4000

playground/css/postcss-caching/css.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'node:path'
22
import { createServer } from 'vite'
3+
import { expect, test } from 'vitest'
34
import { getColor, page, ports } from '~utils'
45

56
test('postcss config', async () => {

playground/data-uri/__tests__/data-uri.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { findAssetFile, isBuild, page } from '~utils'
23

34
test('plain', async () => {

playground/define/__tests__/define.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import viteConfig from '../vite.config'
23
import { page } from '~utils'
34

playground/dynamic-import/__tests__/dynamic-import.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { getColor, page, serverLogs, untilUpdated } from '~utils'
23

34
test('should load literal dynamic import', async () => {

playground/env-nested/__tests__/env-nested.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { isBuild, page } from '~utils'
23

34
const mode = isBuild ? `production` : `development`

playground/env/__tests__/env.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { isBuild, page } from '~utils'
23

34
const mode = isBuild ? `production` : `development`

playground/extensions/__tests__/extensions.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { browserLogs, page } from '~utils'
23

34
test('should have no 404s', () => {

playground/external/__tests__/external.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import { isBuild, page } from '~utils'
23

34
describe.runIf(isBuild)('build', () => {

playground/file-delete-restore/__tests__/file-delete-restore.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { test } from 'vitest'
12
import {
23
addFile,
34
editFile,

playground/fs-serve/__tests__/fs-serve.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { beforeAll, describe, expect, test } from 'vitest'
12
import testJSON from '../safe.json'
23
import { isServe, page, viteTestUrl } from '~utils'
34

playground/glob-import/__tests__/glob-import.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import {
23
addFile,
34
editFile,

playground/hmr/__tests__/hmr.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { beforeAll, describe, expect, it, test } from 'vitest'
12
import {
23
browserLogs,
34
editFile,

playground/js-sourcemap/__tests__/js-sourcemap.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { URL } from 'node:url'
2+
import { expect, test } from 'vitest'
23
import {
34
extractSourcemap,
45
formatSourcemapForSnapshot,

playground/json/__tests__/json.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { readFileSync } from 'node:fs'
2+
import { expect, test } from 'vitest'
23
import testJson from '../test.json'
34
import hmrJson from '../hmr.json'
45
import { editFile, isBuild, isServe, page, untilUpdated } from '~utils'

playground/legacy/__tests__/legacy.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import {
23
findAssetFile,
34
getColor,

playground/legacy/__tests__/ssr/legacy-ssr.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import { port } from './serve'
23
import { isBuild, page } from '~utils'
34

playground/lib/__tests__/lib.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import {
23
isBuild,
34
isServe,

playground/multiple-entrypoints/__tests__/multiple-entrypoints.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { getColor, page, untilUpdated } from '~utils'
23

34
test('should have css applied on second dynamic import', async () => {

playground/nested-deps/__tests__/nested-deps.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { page } from '~utils'
23

34
test('handle nested package', async () => {

playground/optimize-deps/__tests__/optimize-deps.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import {
23
browserErrors,
34
browserLogs,

playground/optimize-missing-deps/__test__/optimize-missing-deps.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { platform } from 'node:os'
22
import fetch from 'node-fetch'
3+
import { expect, test } from 'vitest'
34
import { port } from './serve'
45
import { page, untilUpdated } from '~utils'
56

playground/preload/__tests__/preload.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import { browserLogs, isBuild, page, viteTestUrl } from '~utils'
23

34
test('should have no 404s', () => {

playground/preserve-symlinks/__tests__/preserve-symlinks.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { browserLogs, page } from '~utils'
23

34
test('should have no 404s', () => {

playground/react-classic/__tests__/react.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { editFile, isServe, page, untilUpdated } from '~utils'
23

34
test('should render', async () => {

playground/react-emotion/__tests__/react.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { editFile, page, untilUpdated } from '~utils'
23

34
test('should render', async () => {

playground/react-sourcemap/__tests__/react-sourcemap.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { isBuild, serverLogs } from '~utils'
23

34
test.runIf(isBuild)('should not output sourcemap warning', () => {

playground/react/__tests__/react.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { editFile, isServe, page, untilUpdated } from '~utils'
23

34
test('should render', async () => {

playground/resolve-config/__tests__/resolve-config.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
33
import { execaCommandSync } from 'execa'
4+
import { describe, expect, it } from 'vitest'
45
import { isBuild, testDir, viteBinPath } from '~utils'
56

67
const fromTestDir = (...p: string[]) => path.resolve(testDir, ...p)

playground/resolve/__tests__/resolve.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { isBuild, isWindows, page } from '~utils'
23

34
test('bom import', async () => {

playground/ssr-deps/__tests__/ssr-deps.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { port } from './serve'
23
import { getColor, page } from '~utils'
34

playground/ssr-html/__tests__/ssr-html.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fetch from 'node-fetch'
2+
import { describe, expect, test } from 'vitest'
23
import { port } from './serve'
34
import { page } from '~utils'
45

playground/ssr-pug/__tests__/ssr-pug.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fetch from 'node-fetch'
2+
import { describe, expect, test } from 'vitest'
23
import { port } from './serve'
34
import { page } from '~utils'
45

playground/ssr-react/__tests__/ssr-react.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fetch from 'node-fetch'
2+
import { expect, test } from 'vitest'
23
import { port } from './serve'
34
import { browserLogs, editFile, page, untilUpdated } from '~utils'
45

playground/ssr-vue/__tests__/ssr-vue.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { resolve } from 'node:path'
22
import { fileURLToPath } from 'node:url'
33
import fetch from 'node-fetch'
4+
import { expect, test, vi } from 'vitest'
45
import { port } from './serve'
56
import {
67
browserLogs,

playground/ssr-webworker/__tests__/ssr-webworker.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { port } from './serve'
23
import { findAssetFile, isBuild, page } from '~utils'
34

playground/tailwind-sourcemap/__tests__/tailwind-sourcemap.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { isBuild, serverLogs } from '~utils'
23

34
test.runIf(!isBuild)('should not output missing source file warning', () => {

playground/tailwind/__test__/tailwind.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import {
23
browserLogs,
34
editFile,

playground/test-utils.ts

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// test utils used in e2e tests for playgrounds.
22
// `import { getColor } from '~utils'`
33

4-
// TODO: explicitly import APIs and remove this
5-
/// <reference types="vitest/globals"/>
6-
74
import fs from 'node:fs'
85
import path from 'node:path'
96
import colors from 'css-color-names'

playground/tsconfig-json-load-error/__tests__/serve.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { afterAll } from 'vitest'
12
import { startDefaultServe } from '~utils'
23

34
export let serveError: Error | undefined

playground/tsconfig-json-load-error/__tests__/tsconfig-json-load-error.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import { clearServeError, serveError } from './serve'
23
import {
34
browserLogs,

playground/tsconfig-json/__tests__/tsconfig-json.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from 'node:path'
22
import fs from 'node:fs'
33
import { transformWithEsbuild } from 'vite'
4+
import { describe, expect, test } from 'vitest'
45
import { browserLogs } from '~utils'
56

67
test('should respected each `tsconfig.json`s compilerOptions', () => {

playground/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"skipLibCheck": true,
1414
"noUnusedLocals": true,
1515
"jsx": "preserve",
16-
"types": ["vite/client", "vitest/globals", "node"],
16+
"types": ["vite/client", "node"],
1717
"paths": {
1818
"~utils": ["./test-utils.ts"]
1919
}

playground/vue-jsx/__tests__/vue-jsx.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import { editFile, isServe, page, untilUpdated } from '~utils'
23

34
test('should render', async () => {

playground/vue-lib/__tests__/vue-lib.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'node:path'
22
import { build } from 'vite'
3+
import { describe, expect, test } from 'vitest'
34
import type { OutputChunk, RollupOutput } from 'rollup'
45

56
describe('vue component library', () => {

playground/vue-server-origin/__tests__/vue-server-origin.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { isBuild, page } from '~utils'
23

34
test('should render', async () => {

playground/vue-sourcemap/__tests__/vue-sourcemap.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { URL } from 'node:url'
2+
import { describe, expect, test } from 'vitest'
23
import {
34
extractSourcemap,
45
formatSourcemapForSnapshot,

playground/vue/__tests__/vue.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import {
23
browserLogs,
34
editFile,

playground/wasm/__tests__/wasm.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect, test } from 'vitest'
12
import { isBuild, page, untilUpdated } from '~utils'
23

34
test('should work when inlined', async () => {

playground/worker/__tests__/es/es-worker.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
3+
import { describe, expect, test } from 'vitest'
34
import { isBuild, page, testDir, untilUpdated } from '~utils'
45

56
test('normal', async () => {

playground/worker/__tests__/iife/iife-worker.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
3-
import { test } from 'vitest'
3+
import { describe, expect, test } from 'vitest'
44
import { isBuild, page, testDir, untilUpdated } from '~utils'
55

66
test('normal', async () => {

playground/worker/__tests__/relative-base/relative-base-worker.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
3+
import { describe, expect, test } from 'vitest'
34
import { isBuild, page, testDir, untilUpdated } from '~utils'
45

56
test('normal', async () => {

playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
3+
import { describe, expect, test } from 'vitest'
34
import { isBuild, testDir } from '~utils'
45

56
describe.runIf(isBuild)('build', () => {

playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
3+
import { describe, expect, test } from 'vitest'
34
import { isBuild, testDir } from '~utils'
45

56
describe.runIf(isBuild)('build', () => {

playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
3+
import { describe, expect, test } from 'vitest'
34
import { isBuild, testDir } from '~utils'
45

56
describe.runIf(isBuild)('build', () => {

vitest.config.e2e.ts

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export default defineConfig({
1515
globalSetup: ['./playground/vitestGlobalSetup.ts'],
1616
testTimeout: timeout,
1717
hookTimeout: timeout,
18-
globals: true,
1918
reporters: 'dot',
2019
onConsoleLog(log) {
2120
if (log.match(/experimental|jit engine|emitted file|tailwind/i))

0 commit comments

Comments
 (0)