mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 14:48:41 +00:00
chore: remove vitest global options (#9620)
This commit is contained in:
parent
b1bbc5bcc0
commit
1cf5c78358
@ -1,4 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { beforeAll, describe, expect, test } from 'vitest'
|
||||
import {
|
||||
browserLogs,
|
||||
findAssetFile,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { beforeAll, describe, expect, test } from 'vitest'
|
||||
import {
|
||||
browserLogs,
|
||||
findAssetFile,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import {
|
||||
browserErrors,
|
||||
browserLogs,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { describe, test } from 'vitest'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { page } from '~utils'
|
||||
|
||||
describe('syntax preserve', () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { port } from './serve'
|
||||
import { page } from '~utils'
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { port } from './serve'
|
||||
import { page } from '~utils'
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { findAssetFile, getColor, isBuild, readManifest } from '~utils'
|
||||
|
||||
test('should load both stylesheets', async () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { findAssetFile, getColor, isBuild, page, readManifest } from '~utils'
|
||||
|
||||
test('should load all stylesheets', async () => {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { URL } from 'node:url'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import {
|
||||
extractSourcemap,
|
||||
formatSourcemapForSnapshot,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { expect, test } from 'vitest'
|
||||
import {
|
||||
editFile,
|
||||
findAssetFile,
|
||||
|
@ -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
|
||||
|
@ -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 () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { findAssetFile, isBuild, page } from '~utils'
|
||||
|
||||
test('plain', async () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import viteConfig from '../vite.config'
|
||||
import { page } from '~utils'
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { getColor, page, serverLogs, untilUpdated } from '~utils'
|
||||
|
||||
test('should load literal dynamic import', async () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { isBuild, page } from '~utils'
|
||||
|
||||
const mode = isBuild ? `production` : `development`
|
||||
|
1
playground/env/__tests__/env.spec.ts
vendored
1
playground/env/__tests__/env.spec.ts
vendored
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { isBuild, page } from '~utils'
|
||||
|
||||
const mode = isBuild ? `production` : `development`
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { browserLogs, page } from '~utils'
|
||||
|
||||
test('should have no 404s', () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { isBuild, page } from '~utils'
|
||||
|
||||
describe.runIf(isBuild)('build', () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { test } from 'vitest'
|
||||
import {
|
||||
addFile,
|
||||
editFile,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { beforeAll, describe, expect, test } from 'vitest'
|
||||
import testJSON from '../safe.json'
|
||||
import { isServe, page, viteTestUrl } from '~utils'
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import {
|
||||
addFile,
|
||||
editFile,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { beforeAll, describe, expect, it, test } from 'vitest'
|
||||
import {
|
||||
browserLogs,
|
||||
editFile,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { URL } from 'node:url'
|
||||
import { expect, test } from 'vitest'
|
||||
import {
|
||||
extractSourcemap,
|
||||
formatSourcemapForSnapshot,
|
||||
|
@ -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'
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import {
|
||||
findAssetFile,
|
||||
getColor,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { port } from './serve'
|
||||
import { isBuild, page } from '~utils'
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import {
|
||||
isBuild,
|
||||
isServe,
|
||||
|
@ -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 () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { page } from '~utils'
|
||||
|
||||
test('handle nested package', async () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import {
|
||||
browserErrors,
|
||||
browserLogs,
|
||||
|
@ -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'
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { browserLogs, isBuild, page, viteTestUrl } from '~utils'
|
||||
|
||||
test('should have no 404s', () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { browserLogs, page } from '~utils'
|
||||
|
||||
test('should have no 404s', () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { editFile, isServe, page, untilUpdated } from '~utils'
|
||||
|
||||
test('should render', async () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { editFile, page, untilUpdated } from '~utils'
|
||||
|
||||
test('should render', async () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { isBuild, serverLogs } from '~utils'
|
||||
|
||||
test.runIf(isBuild)('should not output sourcemap warning', () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { editFile, isServe, page, untilUpdated } from '~utils'
|
||||
|
||||
test('should render', async () => {
|
||||
|
@ -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)
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { isBuild, isWindows, page } from '~utils'
|
||||
|
||||
test('bom import', async () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { port } from './serve'
|
||||
import { getColor, page } from '~utils'
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import fetch from 'node-fetch'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { port } from './serve'
|
||||
import { page } from '~utils'
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import fetch from 'node-fetch'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { port } from './serve'
|
||||
import { page } from '~utils'
|
||||
|
||||
|
@ -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'
|
||||
|
||||
|
@ -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,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { port } from './serve'
|
||||
import { findAssetFile, isBuild, page } from '~utils'
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { isBuild, serverLogs } from '~utils'
|
||||
|
||||
test.runIf(!isBuild)('should not output missing source file warning', () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import {
|
||||
browserLogs,
|
||||
editFile,
|
||||
|
@ -1,9 +1,6 @@
|
||||
// test utils used in e2e tests for playgrounds.
|
||||
// `import { getColor } from '~utils'`
|
||||
|
||||
// TODO: explicitly import APIs and remove this
|
||||
/// <reference types="vitest/globals"/>
|
||||
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import colors from 'css-color-names'
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { afterAll } from 'vitest'
|
||||
import { startDefaultServe } from '~utils'
|
||||
|
||||
export let serveError: Error | undefined
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { clearServeError, serveError } from './serve'
|
||||
import {
|
||||
browserLogs,
|
||||
|
@ -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', () => {
|
||||
|
@ -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"]
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { editFile, isServe, page, untilUpdated } from '~utils'
|
||||
|
||||
test('should render', async () => {
|
||||
|
@ -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', () => {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { isBuild, page } from '~utils'
|
||||
|
||||
test('should render', async () => {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { URL } from 'node:url'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import {
|
||||
extractSourcemap,
|
||||
formatSourcemapForSnapshot,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import {
|
||||
browserLogs,
|
||||
editFile,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { isBuild, page, untilUpdated } from '~utils'
|
||||
|
||||
test('should work when inlined', async () => {
|
||||
|
@ -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 () => {
|
||||
|
@ -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 () => {
|
||||
|
@ -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 () => {
|
||||
|
@ -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', () => {
|
||||
|
@ -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', () => {
|
||||
|
@ -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', () => {
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user