diff --git a/playground/assets/__tests__/relative-base/relative-base-assets.spec.ts b/playground/assets/__tests__/relative-base/relative-base-assets.spec.ts index 99544c35b2cd31..f62b23a2083204 100644 --- a/playground/assets/__tests__/relative-base/relative-base-assets.spec.ts +++ b/playground/assets/__tests__/relative-base/relative-base-assets.spec.ts @@ -1,4 +1,4 @@ -import { describe, expect, test } from 'vitest' +import { beforeAll, describe, expect, test } from 'vitest' import { browserLogs, findAssetFile, diff --git a/playground/assets/__tests__/runtime-base/runtime-base-assets.spec.ts b/playground/assets/__tests__/runtime-base/runtime-base-assets.spec.ts index 7b769c0fa83536..90cd764cafe209 100644 --- a/playground/assets/__tests__/runtime-base/runtime-base-assets.spec.ts +++ b/playground/assets/__tests__/runtime-base/runtime-base-assets.spec.ts @@ -1,4 +1,4 @@ -import { describe, expect, test } from 'vitest' +import { beforeAll, describe, expect, test } from 'vitest' import { browserLogs, findAssetFile, diff --git a/playground/backend-integration/__tests__/backend-integration.spec.ts b/playground/backend-integration/__tests__/backend-integration.spec.ts index a6b773bf791ddb..bd3ee1655dd976 100644 --- a/playground/backend-integration/__tests__/backend-integration.spec.ts +++ b/playground/backend-integration/__tests__/backend-integration.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { browserErrors, browserLogs, diff --git a/playground/build-old/__tests__/build-old.spec.ts b/playground/build-old/__tests__/build-old.spec.ts index 085d1bbe75b986..517b204e7dde82 100644 --- a/playground/build-old/__tests__/build-old.spec.ts +++ b/playground/build-old/__tests__/build-old.spec.ts @@ -1,4 +1,4 @@ -import { describe, test } from 'vitest' +import { describe, expect, test } from 'vitest' import { page } from '~utils' describe('syntax preserve', () => { diff --git a/playground/cli-module/__tests__/cli-module.spec.ts b/playground/cli-module/__tests__/cli-module.spec.ts index a443a66c9810dc..ef109e75cc77cc 100644 --- a/playground/cli-module/__tests__/cli-module.spec.ts +++ b/playground/cli-module/__tests__/cli-module.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { port } from './serve' import { page } from '~utils' diff --git a/playground/cli/__tests__/cli.spec.ts b/playground/cli/__tests__/cli.spec.ts index 676d076a1aaeed..4ec4d613d20d9a 100644 --- a/playground/cli/__tests__/cli.spec.ts +++ b/playground/cli/__tests__/cli.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { port } from './serve' import { page } from '~utils' diff --git a/playground/css-codesplit-cjs/__tests__/css-codesplit.spec.ts b/playground/css-codesplit-cjs/__tests__/css-codesplit.spec.ts index dc51f0a2e473c1..69001c61bdb82b 100644 --- a/playground/css-codesplit-cjs/__tests__/css-codesplit.spec.ts +++ b/playground/css-codesplit-cjs/__tests__/css-codesplit.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { findAssetFile, getColor, isBuild, readManifest } from '~utils' test('should load both stylesheets', async () => { diff --git a/playground/css-codesplit/__tests__/css-codesplit.spec.ts b/playground/css-codesplit/__tests__/css-codesplit.spec.ts index f00dfed1d92453..203316c7565932 100644 --- a/playground/css-codesplit/__tests__/css-codesplit.spec.ts +++ b/playground/css-codesplit/__tests__/css-codesplit.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { findAssetFile, getColor, isBuild, page, readManifest } from '~utils' test('should load all stylesheets', async () => { diff --git a/playground/css-sourcemap/__tests__/css-sourcemap.spec.ts b/playground/css-sourcemap/__tests__/css-sourcemap.spec.ts index f63ef8946eba40..cee31201cb2f6f 100644 --- a/playground/css-sourcemap/__tests__/css-sourcemap.spec.ts +++ b/playground/css-sourcemap/__tests__/css-sourcemap.spec.ts @@ -1,4 +1,5 @@ import { URL } from 'node:url' +import { describe, expect, test } from 'vitest' import { extractSourcemap, formatSourcemapForSnapshot, diff --git a/playground/css/__tests__/css.spec.ts b/playground/css/__tests__/css.spec.ts index 31425a19fc2c98..0053b184e8b197 100644 --- a/playground/css/__tests__/css.spec.ts +++ b/playground/css/__tests__/css.spec.ts @@ -1,4 +1,5 @@ import { readFileSync } from 'node:fs' +import { expect, test } from 'vitest' import { editFile, findAssetFile, diff --git a/playground/css/__tests__/postcss-plugins-different-dir/postcss-plugins-different-dir.spec.ts b/playground/css/__tests__/postcss-plugins-different-dir/postcss-plugins-different-dir.spec.ts index 346309f7fcc32d..fabf24da3dae99 100644 --- a/playground/css/__tests__/postcss-plugins-different-dir/postcss-plugins-different-dir.spec.ts +++ b/playground/css/__tests__/postcss-plugins-different-dir/postcss-plugins-different-dir.spec.ts @@ -1,5 +1,6 @@ import path from 'node:path' import { createServer } from 'vite' +import { expect, test } from 'vitest' import { getBgColor, getColor, page, ports } from '~utils' // Regression test for https://github.com/vitejs/vite/issues/4000 diff --git a/playground/css/postcss-caching/css.spec.ts b/playground/css/postcss-caching/css.spec.ts index cb962f1151c5a8..c32bf6b6251d2d 100644 --- a/playground/css/postcss-caching/css.spec.ts +++ b/playground/css/postcss-caching/css.spec.ts @@ -1,5 +1,6 @@ import path from 'node:path' import { createServer } from 'vite' +import { expect, test } from 'vitest' import { getColor, page, ports } from '~utils' test('postcss config', async () => { diff --git a/playground/data-uri/__tests__/data-uri.spec.ts b/playground/data-uri/__tests__/data-uri.spec.ts index 4b7f3d6e1e471b..7d9ab64594c663 100644 --- a/playground/data-uri/__tests__/data-uri.spec.ts +++ b/playground/data-uri/__tests__/data-uri.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { findAssetFile, isBuild, page } from '~utils' test('plain', async () => { diff --git a/playground/define/__tests__/define.spec.ts b/playground/define/__tests__/define.spec.ts index c22a622f3bfc21..43787ef0adb112 100644 --- a/playground/define/__tests__/define.spec.ts +++ b/playground/define/__tests__/define.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import viteConfig from '../vite.config' import { page } from '~utils' diff --git a/playground/dynamic-import/__tests__/dynamic-import.spec.ts b/playground/dynamic-import/__tests__/dynamic-import.spec.ts index c8a90a32aeaf75..0612cf7808410b 100644 --- a/playground/dynamic-import/__tests__/dynamic-import.spec.ts +++ b/playground/dynamic-import/__tests__/dynamic-import.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { getColor, page, serverLogs, untilUpdated } from '~utils' test('should load literal dynamic import', async () => { diff --git a/playground/env-nested/__tests__/env-nested.spec.ts b/playground/env-nested/__tests__/env-nested.spec.ts index 2ae9ab64023896..ea4cdeb88e72c4 100644 --- a/playground/env-nested/__tests__/env-nested.spec.ts +++ b/playground/env-nested/__tests__/env-nested.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { isBuild, page } from '~utils' const mode = isBuild ? `production` : `development` diff --git a/playground/env/__tests__/env.spec.ts b/playground/env/__tests__/env.spec.ts index e093d4bc414353..0fe029422ecfbd 100644 --- a/playground/env/__tests__/env.spec.ts +++ b/playground/env/__tests__/env.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { isBuild, page } from '~utils' const mode = isBuild ? `production` : `development` diff --git a/playground/extensions/__tests__/extensions.spec.ts b/playground/extensions/__tests__/extensions.spec.ts index eb497a280e711a..a2e229ffcd37f3 100644 --- a/playground/extensions/__tests__/extensions.spec.ts +++ b/playground/extensions/__tests__/extensions.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { browserLogs, page } from '~utils' test('should have no 404s', () => { diff --git a/playground/external/__tests__/external.spec.ts b/playground/external/__tests__/external.spec.ts index ed1d1872181c02..cff0fd69d0968e 100644 --- a/playground/external/__tests__/external.spec.ts +++ b/playground/external/__tests__/external.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { isBuild, page } from '~utils' describe.runIf(isBuild)('build', () => { diff --git a/playground/file-delete-restore/__tests__/file-delete-restore.spec.ts b/playground/file-delete-restore/__tests__/file-delete-restore.spec.ts index a54f4b8da8e77e..943cabb35da2c2 100644 --- a/playground/file-delete-restore/__tests__/file-delete-restore.spec.ts +++ b/playground/file-delete-restore/__tests__/file-delete-restore.spec.ts @@ -1,3 +1,4 @@ +import { test } from 'vitest' import { addFile, editFile, diff --git a/playground/fs-serve/__tests__/fs-serve.spec.ts b/playground/fs-serve/__tests__/fs-serve.spec.ts index 142b4ac9ca3131..8fcb3f61125158 100644 --- a/playground/fs-serve/__tests__/fs-serve.spec.ts +++ b/playground/fs-serve/__tests__/fs-serve.spec.ts @@ -1,3 +1,4 @@ +import { beforeAll, describe, expect, test } from 'vitest' import testJSON from '../safe.json' import { isServe, page, viteTestUrl } from '~utils' diff --git a/playground/glob-import/__tests__/glob-import.spec.ts b/playground/glob-import/__tests__/glob-import.spec.ts index fb1cb867358549..68608875f3c429 100644 --- a/playground/glob-import/__tests__/glob-import.spec.ts +++ b/playground/glob-import/__tests__/glob-import.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { addFile, editFile, diff --git a/playground/hmr/__tests__/hmr.spec.ts b/playground/hmr/__tests__/hmr.spec.ts index c3a155098d7f1a..d0635fc04db9ee 100644 --- a/playground/hmr/__tests__/hmr.spec.ts +++ b/playground/hmr/__tests__/hmr.spec.ts @@ -1,3 +1,4 @@ +import { beforeAll, describe, expect, it, test } from 'vitest' import { browserLogs, editFile, diff --git a/playground/js-sourcemap/__tests__/js-sourcemap.spec.ts b/playground/js-sourcemap/__tests__/js-sourcemap.spec.ts index a7ecbdf145af4a..a54bd761f13592 100644 --- a/playground/js-sourcemap/__tests__/js-sourcemap.spec.ts +++ b/playground/js-sourcemap/__tests__/js-sourcemap.spec.ts @@ -1,4 +1,5 @@ import { URL } from 'node:url' +import { expect, test } from 'vitest' import { extractSourcemap, formatSourcemapForSnapshot, diff --git a/playground/json/__tests__/json.spec.ts b/playground/json/__tests__/json.spec.ts index 09530627a580f0..d4e074b5f244bc 100644 --- a/playground/json/__tests__/json.spec.ts +++ b/playground/json/__tests__/json.spec.ts @@ -1,4 +1,5 @@ import { readFileSync } from 'node:fs' +import { expect, test } from 'vitest' import testJson from '../test.json' import hmrJson from '../hmr.json' import { editFile, isBuild, isServe, page, untilUpdated } from '~utils' diff --git a/playground/legacy/__tests__/legacy.spec.ts b/playground/legacy/__tests__/legacy.spec.ts index 2a2a0698d65b04..cee22bbd39c981 100644 --- a/playground/legacy/__tests__/legacy.spec.ts +++ b/playground/legacy/__tests__/legacy.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { findAssetFile, getColor, diff --git a/playground/legacy/__tests__/ssr/legacy-ssr.spec.ts b/playground/legacy/__tests__/ssr/legacy-ssr.spec.ts index b5cfe82cd93910..b42c268daf8b80 100644 --- a/playground/legacy/__tests__/ssr/legacy-ssr.spec.ts +++ b/playground/legacy/__tests__/ssr/legacy-ssr.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { port } from './serve' import { isBuild, page } from '~utils' diff --git a/playground/lib/__tests__/lib.spec.ts b/playground/lib/__tests__/lib.spec.ts index 9046097f7e8375..54a7613d04cdce 100644 --- a/playground/lib/__tests__/lib.spec.ts +++ b/playground/lib/__tests__/lib.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { isBuild, isServe, diff --git a/playground/multiple-entrypoints/__tests__/multiple-entrypoints.spec.ts b/playground/multiple-entrypoints/__tests__/multiple-entrypoints.spec.ts index e61c2187556f08..8215fb8f301fab 100644 --- a/playground/multiple-entrypoints/__tests__/multiple-entrypoints.spec.ts +++ b/playground/multiple-entrypoints/__tests__/multiple-entrypoints.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { getColor, page, untilUpdated } from '~utils' test('should have css applied on second dynamic import', async () => { diff --git a/playground/nested-deps/__tests__/nested-deps.spec.ts b/playground/nested-deps/__tests__/nested-deps.spec.ts index 00298ef0e260c8..19c280b228b551 100644 --- a/playground/nested-deps/__tests__/nested-deps.spec.ts +++ b/playground/nested-deps/__tests__/nested-deps.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { page } from '~utils' test('handle nested package', async () => { diff --git a/playground/optimize-deps/__tests__/optimize-deps.spec.ts b/playground/optimize-deps/__tests__/optimize-deps.spec.ts index a62b4525e057be..df0c080f09ab47 100644 --- a/playground/optimize-deps/__tests__/optimize-deps.spec.ts +++ b/playground/optimize-deps/__tests__/optimize-deps.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { browserErrors, browserLogs, diff --git a/playground/optimize-missing-deps/__test__/optimize-missing-deps.spec.ts b/playground/optimize-missing-deps/__test__/optimize-missing-deps.spec.ts index c84764897c18db..c4c455eaaf7bbb 100644 --- a/playground/optimize-missing-deps/__test__/optimize-missing-deps.spec.ts +++ b/playground/optimize-missing-deps/__test__/optimize-missing-deps.spec.ts @@ -1,5 +1,6 @@ import { platform } from 'node:os' import fetch from 'node-fetch' +import { expect, test } from 'vitest' import { port } from './serve' import { page, untilUpdated } from '~utils' diff --git a/playground/preload/__tests__/preload.spec.ts b/playground/preload/__tests__/preload.spec.ts index bd172a60ce19cf..a133fa7b96bc50 100644 --- a/playground/preload/__tests__/preload.spec.ts +++ b/playground/preload/__tests__/preload.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { browserLogs, isBuild, page, viteTestUrl } from '~utils' test('should have no 404s', () => { diff --git a/playground/preserve-symlinks/__tests__/preserve-symlinks.spec.ts b/playground/preserve-symlinks/__tests__/preserve-symlinks.spec.ts index c33069fbc48cc9..0748841a2ad64d 100644 --- a/playground/preserve-symlinks/__tests__/preserve-symlinks.spec.ts +++ b/playground/preserve-symlinks/__tests__/preserve-symlinks.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { browserLogs, page } from '~utils' test('should have no 404s', () => { diff --git a/playground/react-classic/__tests__/react.spec.ts b/playground/react-classic/__tests__/react.spec.ts index 8381992d59df3d..15f6319220d7f2 100644 --- a/playground/react-classic/__tests__/react.spec.ts +++ b/playground/react-classic/__tests__/react.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { editFile, isServe, page, untilUpdated } from '~utils' test('should render', async () => { diff --git a/playground/react-emotion/__tests__/react.spec.ts b/playground/react-emotion/__tests__/react.spec.ts index ceb594ee259e1c..d326a4ad0abeb8 100644 --- a/playground/react-emotion/__tests__/react.spec.ts +++ b/playground/react-emotion/__tests__/react.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { editFile, page, untilUpdated } from '~utils' test('should render', async () => { diff --git a/playground/react-sourcemap/__tests__/react-sourcemap.spec.ts b/playground/react-sourcemap/__tests__/react-sourcemap.spec.ts index a1d35485760753..e5527ca71ea693 100644 --- a/playground/react-sourcemap/__tests__/react-sourcemap.spec.ts +++ b/playground/react-sourcemap/__tests__/react-sourcemap.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { isBuild, serverLogs } from '~utils' test.runIf(isBuild)('should not output sourcemap warning', () => { diff --git a/playground/react/__tests__/react.spec.ts b/playground/react/__tests__/react.spec.ts index 8381992d59df3d..15f6319220d7f2 100644 --- a/playground/react/__tests__/react.spec.ts +++ b/playground/react/__tests__/react.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { editFile, isServe, page, untilUpdated } from '~utils' test('should render', async () => { diff --git a/playground/resolve-config/__tests__/resolve-config.spec.ts b/playground/resolve-config/__tests__/resolve-config.spec.ts index 6682deb9805a34..7c9d003791b4d9 100644 --- a/playground/resolve-config/__tests__/resolve-config.spec.ts +++ b/playground/resolve-config/__tests__/resolve-config.spec.ts @@ -1,6 +1,7 @@ import fs from 'node:fs' import path from 'node:path' import { execaCommandSync } from 'execa' +import { describe, expect, it } from 'vitest' import { isBuild, testDir, viteBinPath } from '~utils' const fromTestDir = (...p: string[]) => path.resolve(testDir, ...p) diff --git a/playground/resolve/__tests__/resolve.spec.ts b/playground/resolve/__tests__/resolve.spec.ts index ef125d4409ec9b..8d788949b67e32 100644 --- a/playground/resolve/__tests__/resolve.spec.ts +++ b/playground/resolve/__tests__/resolve.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { isBuild, isWindows, page } from '~utils' test('bom import', async () => { diff --git a/playground/ssr-deps/__tests__/ssr-deps.spec.ts b/playground/ssr-deps/__tests__/ssr-deps.spec.ts index 26bec1fe2de2c0..9e7932001b3ace 100644 --- a/playground/ssr-deps/__tests__/ssr-deps.spec.ts +++ b/playground/ssr-deps/__tests__/ssr-deps.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { port } from './serve' import { getColor, page } from '~utils' diff --git a/playground/ssr-html/__tests__/ssr-html.spec.ts b/playground/ssr-html/__tests__/ssr-html.spec.ts index bcf66c8f5ad128..f29b0ac33cf5d8 100644 --- a/playground/ssr-html/__tests__/ssr-html.spec.ts +++ b/playground/ssr-html/__tests__/ssr-html.spec.ts @@ -1,4 +1,5 @@ import fetch from 'node-fetch' +import { describe, expect, test } from 'vitest' import { port } from './serve' import { page } from '~utils' diff --git a/playground/ssr-pug/__tests__/ssr-pug.spec.ts b/playground/ssr-pug/__tests__/ssr-pug.spec.ts index bcf66c8f5ad128..f29b0ac33cf5d8 100644 --- a/playground/ssr-pug/__tests__/ssr-pug.spec.ts +++ b/playground/ssr-pug/__tests__/ssr-pug.spec.ts @@ -1,4 +1,5 @@ import fetch from 'node-fetch' +import { describe, expect, test } from 'vitest' import { port } from './serve' import { page } from '~utils' diff --git a/playground/ssr-react/__tests__/ssr-react.spec.ts b/playground/ssr-react/__tests__/ssr-react.spec.ts index 49b031f9e70fd8..321c80d67614b0 100644 --- a/playground/ssr-react/__tests__/ssr-react.spec.ts +++ b/playground/ssr-react/__tests__/ssr-react.spec.ts @@ -1,4 +1,5 @@ import fetch from 'node-fetch' +import { expect, test } from 'vitest' import { port } from './serve' import { browserLogs, editFile, page, untilUpdated } from '~utils' diff --git a/playground/ssr-vue/__tests__/ssr-vue.spec.ts b/playground/ssr-vue/__tests__/ssr-vue.spec.ts index 7d4d1ec0f7ab87..d812a167d17fd4 100644 --- a/playground/ssr-vue/__tests__/ssr-vue.spec.ts +++ b/playground/ssr-vue/__tests__/ssr-vue.spec.ts @@ -1,6 +1,7 @@ import { resolve } from 'node:path' import { fileURLToPath } from 'node:url' import fetch from 'node-fetch' +import { expect, test, vi } from 'vitest' import { port } from './serve' import { browserLogs, diff --git a/playground/ssr-webworker/__tests__/ssr-webworker.spec.ts b/playground/ssr-webworker/__tests__/ssr-webworker.spec.ts index 931e8f7d32199f..6f88c4331a553c 100644 --- a/playground/ssr-webworker/__tests__/ssr-webworker.spec.ts +++ b/playground/ssr-webworker/__tests__/ssr-webworker.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { port } from './serve' import { findAssetFile, isBuild, page } from '~utils' diff --git a/playground/tailwind-sourcemap/__tests__/tailwind-sourcemap.spec.ts b/playground/tailwind-sourcemap/__tests__/tailwind-sourcemap.spec.ts index 86238ab800f24e..8a5bf52e38cb64 100644 --- a/playground/tailwind-sourcemap/__tests__/tailwind-sourcemap.spec.ts +++ b/playground/tailwind-sourcemap/__tests__/tailwind-sourcemap.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { isBuild, serverLogs } from '~utils' test.runIf(!isBuild)('should not output missing source file warning', () => { diff --git a/playground/tailwind/__test__/tailwind.spec.ts b/playground/tailwind/__test__/tailwind.spec.ts index d72680cc522f64..7698ca2573387d 100644 --- a/playground/tailwind/__test__/tailwind.spec.ts +++ b/playground/tailwind/__test__/tailwind.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { browserLogs, editFile, diff --git a/playground/test-utils.ts b/playground/test-utils.ts index 17e4517df43776..1364c56e477b10 100644 --- a/playground/test-utils.ts +++ b/playground/test-utils.ts @@ -1,9 +1,6 @@ // test utils used in e2e tests for playgrounds. // `import { getColor } from '~utils'` -// TODO: explicitly import APIs and remove this -/// - import fs from 'node:fs' import path from 'node:path' import colors from 'css-color-names' diff --git a/playground/tsconfig-json-load-error/__tests__/serve.ts b/playground/tsconfig-json-load-error/__tests__/serve.ts index b2d63428db630b..811996bcabb6c8 100644 --- a/playground/tsconfig-json-load-error/__tests__/serve.ts +++ b/playground/tsconfig-json-load-error/__tests__/serve.ts @@ -1,3 +1,4 @@ +import { afterAll } from 'vitest' import { startDefaultServe } from '~utils' export let serveError: Error | undefined diff --git a/playground/tsconfig-json-load-error/__tests__/tsconfig-json-load-error.spec.ts b/playground/tsconfig-json-load-error/__tests__/tsconfig-json-load-error.spec.ts index 9235913e1ce496..37f9290250249e 100644 --- a/playground/tsconfig-json-load-error/__tests__/tsconfig-json-load-error.spec.ts +++ b/playground/tsconfig-json-load-error/__tests__/tsconfig-json-load-error.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { clearServeError, serveError } from './serve' import { browserLogs, diff --git a/playground/tsconfig-json/__tests__/tsconfig-json.spec.ts b/playground/tsconfig-json/__tests__/tsconfig-json.spec.ts index a22f15ef46785f..f447174cf43f23 100644 --- a/playground/tsconfig-json/__tests__/tsconfig-json.spec.ts +++ b/playground/tsconfig-json/__tests__/tsconfig-json.spec.ts @@ -1,6 +1,7 @@ import path from 'node:path' import fs from 'node:fs' import { transformWithEsbuild } from 'vite' +import { describe, expect, test } from 'vitest' import { browserLogs } from '~utils' test('should respected each `tsconfig.json`s compilerOptions', () => { diff --git a/playground/tsconfig.json b/playground/tsconfig.json index cbf237ee6d4653..7e125f860d6468 100644 --- a/playground/tsconfig.json +++ b/playground/tsconfig.json @@ -13,7 +13,7 @@ "skipLibCheck": true, "noUnusedLocals": true, "jsx": "preserve", - "types": ["vite/client", "vitest/globals", "node"], + "types": ["vite/client", "node"], "paths": { "~utils": ["./test-utils.ts"] } diff --git a/playground/vue-jsx/__tests__/vue-jsx.spec.ts b/playground/vue-jsx/__tests__/vue-jsx.spec.ts index 2e6858dacce3c4..7518f4bddd7c71 100644 --- a/playground/vue-jsx/__tests__/vue-jsx.spec.ts +++ b/playground/vue-jsx/__tests__/vue-jsx.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { editFile, isServe, page, untilUpdated } from '~utils' test('should render', async () => { diff --git a/playground/vue-lib/__tests__/vue-lib.spec.ts b/playground/vue-lib/__tests__/vue-lib.spec.ts index e5ad2864ffabff..64f318656ca10e 100644 --- a/playground/vue-lib/__tests__/vue-lib.spec.ts +++ b/playground/vue-lib/__tests__/vue-lib.spec.ts @@ -1,5 +1,6 @@ import path from 'node:path' import { build } from 'vite' +import { describe, expect, test } from 'vitest' import type { OutputChunk, RollupOutput } from 'rollup' describe('vue component library', () => { diff --git a/playground/vue-server-origin/__tests__/vue-server-origin.spec.ts b/playground/vue-server-origin/__tests__/vue-server-origin.spec.ts index 042105721f2615..6af3e7422a5b29 100644 --- a/playground/vue-server-origin/__tests__/vue-server-origin.spec.ts +++ b/playground/vue-server-origin/__tests__/vue-server-origin.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { isBuild, page } from '~utils' test('should render', async () => { diff --git a/playground/vue-sourcemap/__tests__/vue-sourcemap.spec.ts b/playground/vue-sourcemap/__tests__/vue-sourcemap.spec.ts index 2241af413eee94..ee6473c6304e4e 100644 --- a/playground/vue-sourcemap/__tests__/vue-sourcemap.spec.ts +++ b/playground/vue-sourcemap/__tests__/vue-sourcemap.spec.ts @@ -1,4 +1,5 @@ import { URL } from 'node:url' +import { describe, expect, test } from 'vitest' import { extractSourcemap, formatSourcemapForSnapshot, diff --git a/playground/vue/__tests__/vue.spec.ts b/playground/vue/__tests__/vue.spec.ts index b2fbcf4e093cf5..51dbf82a480aff 100644 --- a/playground/vue/__tests__/vue.spec.ts +++ b/playground/vue/__tests__/vue.spec.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from 'vitest' import { browserLogs, editFile, diff --git a/playground/wasm/__tests__/wasm.spec.ts b/playground/wasm/__tests__/wasm.spec.ts index ad4438992609f9..07f383d2eb8b48 100644 --- a/playground/wasm/__tests__/wasm.spec.ts +++ b/playground/wasm/__tests__/wasm.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { isBuild, page, untilUpdated } from '~utils' test('should work when inlined', async () => { diff --git a/playground/worker/__tests__/es/es-worker.spec.ts b/playground/worker/__tests__/es/es-worker.spec.ts index 2bffbb69df6502..5dd4d4c045d834 100644 --- a/playground/worker/__tests__/es/es-worker.spec.ts +++ b/playground/worker/__tests__/es/es-worker.spec.ts @@ -1,5 +1,6 @@ import fs from 'node:fs' import path from 'node:path' +import { describe, expect, test } from 'vitest' import { isBuild, page, testDir, untilUpdated } from '~utils' test('normal', async () => { diff --git a/playground/worker/__tests__/iife/iife-worker.spec.ts b/playground/worker/__tests__/iife/iife-worker.spec.ts index 6a97c8b2023194..b3c1ecfe28d632 100644 --- a/playground/worker/__tests__/iife/iife-worker.spec.ts +++ b/playground/worker/__tests__/iife/iife-worker.spec.ts @@ -1,6 +1,6 @@ import fs from 'node:fs' import path from 'node:path' -import { test } from 'vitest' +import { describe, expect, test } from 'vitest' import { isBuild, page, testDir, untilUpdated } from '~utils' test('normal', async () => { diff --git a/playground/worker/__tests__/relative-base/relative-base-worker.spec.ts b/playground/worker/__tests__/relative-base/relative-base-worker.spec.ts index 11d1c185324fa2..431b0bb54f96f8 100644 --- a/playground/worker/__tests__/relative-base/relative-base-worker.spec.ts +++ b/playground/worker/__tests__/relative-base/relative-base-worker.spec.ts @@ -1,5 +1,6 @@ import fs from 'node:fs' import path from 'node:path' +import { describe, expect, test } from 'vitest' import { isBuild, page, testDir, untilUpdated } from '~utils' test('normal', async () => { diff --git a/playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts b/playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts index 80cc7fa63ee900..ef5bea0090cb63 100644 --- a/playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts +++ b/playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts @@ -1,5 +1,6 @@ import fs from 'node:fs' import path from 'node:path' +import { describe, expect, test } from 'vitest' import { isBuild, testDir } from '~utils' describe.runIf(isBuild)('build', () => { diff --git a/playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts b/playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts index b56bf23f2b3892..7d3ed6d266ed19 100644 --- a/playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts +++ b/playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts @@ -1,5 +1,6 @@ import fs from 'node:fs' import path from 'node:path' +import { describe, expect, test } from 'vitest' import { isBuild, testDir } from '~utils' describe.runIf(isBuild)('build', () => { diff --git a/playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts b/playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts index 955bf22803ac33..2ba5d31d44fc1c 100644 --- a/playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts +++ b/playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts @@ -1,5 +1,6 @@ import fs from 'node:fs' import path from 'node:path' +import { describe, expect, test } from 'vitest' import { isBuild, testDir } from '~utils' describe.runIf(isBuild)('build', () => { diff --git a/vitest.config.e2e.ts b/vitest.config.e2e.ts index 4bed40a9a46e69..da47d97de9abea 100644 --- a/vitest.config.e2e.ts +++ b/vitest.config.e2e.ts @@ -15,7 +15,6 @@ export default defineConfig({ globalSetup: ['./playground/vitestGlobalSetup.ts'], testTimeout: timeout, hookTimeout: timeout, - globals: true, reporters: 'dot', onConsoleLog(log) { if (log.match(/experimental|jit engine|emitted file|tailwind/i))