mirror of
https://github.com/hanzoai/vitest.git
synced 2026-09-24 17:04:25 +00:00
chore(deps): update dependency @antfu/eslint-config to v9 (#10801)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Vladimir Sheremet <[email protected]>
This commit is contained in:
committed by
GitHub
co-authored by
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Vladimir Sheremet
parent
53080ecd56
commit
8043195236
+2
-2
@@ -63,8 +63,6 @@ export default antfu(
|
||||
'ts/no-unsafe-function-type': 'off',
|
||||
|
||||
'markdown/fenced-code-language': 'off',
|
||||
// it uses parser which is not compatible with vitepress
|
||||
'markdown/no-missing-link-fragments': 'off',
|
||||
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
@@ -117,6 +115,8 @@ export default antfu(
|
||||
`**/*.md/${GLOB_SRC}`,
|
||||
],
|
||||
rules: {
|
||||
// it uses parser which is not compatible with vitepress
|
||||
'markdown/no-missing-link-fragments': 'off',
|
||||
'prefer-arrow-callback': 'off',
|
||||
'perfectionist/sort-imports': 'off',
|
||||
'style/max-statements-per-line': 'off',
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@
|
||||
"test:browser:playwright": "pnpm -C test/browser run test:playwright"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^7.7.3",
|
||||
"@antfu/eslint-config": "^9.2.0",
|
||||
"@playwright/test": "catalog:",
|
||||
"@rollup/plugin-commonjs": "^29.0.3",
|
||||
"@rollup/plugin-json": "^6.1.0",
|
||||
|
||||
@@ -2,9 +2,9 @@ import type { DevEnvironment, ViteDevServer } from 'vite'
|
||||
import type { ResolvedConfig } from '../types/config'
|
||||
import type { VitestFetchFunction } from './fetchModule'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { VitestModuleEvaluator } from '#module-evaluator'
|
||||
import { isRunnableDevEnvironment } from 'vite'
|
||||
import { ModuleRunner } from 'vite/module-runner'
|
||||
import { VitestModuleEvaluator } from '#module-evaluator'
|
||||
import { normalizeResolvedIdToUrl } from './normalizeUrl'
|
||||
|
||||
export class ServerModuleRunner extends ModuleRunner {
|
||||
|
||||
Generated
+475
-419
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
import { createNode } from '#src/createNode'
|
||||
import { afterAll, beforeEach, describe, expect, test } from 'vitest'
|
||||
import { page } from 'vitest/browser'
|
||||
import { createNode } from '#src/createNode'
|
||||
import '../src/button.css'
|
||||
|
||||
afterAll(() => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { TestUserConfig } from 'vitest/node'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { playwright } from '@vitest/browser-playwright'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
const configs: TestUserConfig[] = []
|
||||
const pools: TestUserConfig[] = [
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { TestFsStructure } from '#test-utils'
|
||||
import type { ViteUserConfig } from 'vitest/config'
|
||||
import type { CliOptions, TestUserConfig, VitestOptions } from 'vitest/node'
|
||||
import { createConsole, runVitest, runVitestCli, useTmpFS } from '#test-utils'
|
||||
import type { TestFsStructure } from '#test-utils'
|
||||
import { playwright } from '@vitest/browser-playwright'
|
||||
import { preview } from '@vitest/browser-preview'
|
||||
import { resolve } from 'pathe'
|
||||
import { describe, expect, onTestFailed, onTestFinished, test, vi } from 'vitest'
|
||||
import { createVitest, Logger, PluginHarness, resolveConfig } from 'vitest/node'
|
||||
import { createConsole, runVitest, runVitestCli, useTmpFS } from '#test-utils'
|
||||
import { Cli } from '../../../test-utils/cli'
|
||||
|
||||
const vitest = vi.defineHelper(async (options: TestUserConfig & { $viteConfig?: ViteUserConfig; $cliConfig?: CliOptions }, vitestOptions: VitestOptions = {}) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { replaceRoot, runInlineTests, ts } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { replaceRoot, runInlineTests, ts } from '#test-utils'
|
||||
|
||||
const pools = ['forks', 'vmThreads'] as const
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { InlineConfig } from 'vitest/node'
|
||||
import { runInlineTests, runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runInlineTests, runVitest } from '#test-utils'
|
||||
|
||||
function run(sequence: InlineConfig['sequence']) {
|
||||
return runVitest({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { resolve } from 'node:path'
|
||||
import { editFile, runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { editFile, runVitest } from '#test-utils'
|
||||
|
||||
const root = resolve(import.meta.dirname, '../../fixtures/config/watch-trigger-pattern')
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
test('formatting of non-ascii placeholders in test.each', async () => {
|
||||
const { stderr, ctx } = await runInlineTests({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
test('import a generated file', async () => {
|
||||
const { stderr, stdout, testTree } = await runInlineTests({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TestUserConfig } from 'vitest/node'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
test.for([
|
||||
{ isolate: true },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { editFile, resolvePath, runVitestCli } from '#test-utils'
|
||||
import { test as baseTest, expect } from 'vitest'
|
||||
import { editFile, resolvePath, runVitestCli } from '#test-utils'
|
||||
|
||||
// ecosystem-ci updated package.json and make this test fail
|
||||
const test = baseTest.skipIf(!!process.env.ECOSYSTEM_CI)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { RunVitestConfig, TestFsStructure, VitestRunnerCLIOptions } from '#test-utils'
|
||||
import { rmSync } from 'node:fs'
|
||||
import module from 'node:module'
|
||||
import { replaceRoot, runInlineTests, runVitest } from '#test-utils'
|
||||
import { describe, expect, onTestFinished, test } from 'vitest'
|
||||
import { replaceRoot, runInlineTests, runVitest } from '#test-utils'
|
||||
import { readCoverageJson } from '../../coverage-test/utils'
|
||||
|
||||
describe.runIf(module.registerHooks)('supported', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
const nodeMajor = Number(process.version.slice(1).split('.')[0])
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { ResolvedConfig as ResolvedViteConfig, UserConfig as ViteUserConfig } from 'vite'
|
||||
import type { CliOptions, ResolvedConfig, TestUserConfig } from 'vitest/node'
|
||||
import { resolveTestConfig } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { parseCLI } from 'vitest/node'
|
||||
import { resolveTestConfig } from '#test-utils'
|
||||
|
||||
async function config(options: TestUserConfig & { $cliOptions?: CliOptions; $viteConfig?: ViteUserConfig }) {
|
||||
const { config } = await resolveTestConfig(options) as any
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { sep } from 'node:path'
|
||||
import { runInlineTests, runVitest, StableTestFileOrderSorter } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runInlineTests, runVitest, StableTestFileOrderSorter } from '#test-utils'
|
||||
import { readCoverageMap } from '../../coverage-test/utils'
|
||||
|
||||
test('worker death on a shared runner does not skip coverage finalization', async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { runInlineTests, runVitest, ts } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { runInlineTests, runVitest, ts } from '#test-utils'
|
||||
|
||||
it('runs the workspace if there are several vitest config files', async () => {
|
||||
const { stderr, stdout } = await runVitest({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { runVitest, StableTestFileOrderSorter } from '#test-utils'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { DefaultReporter } from 'vitest/node'
|
||||
import { runVitest, StableTestFileOrderSorter } from '#test-utils'
|
||||
import { trimReporterOutput } from './utils'
|
||||
|
||||
describe('agent reporter', async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('show code frame', async () => {
|
||||
const filename = resolve('./fixtures/reporters/code-frame-line-limit.test.ts')
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { UserConsoleLog } from 'vitest'
|
||||
import type { Reporter } from 'vitest/node'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { expect, test } from 'vitest'
|
||||
import { DefaultReporter } from 'vitest/node'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
class LogReporter extends DefaultReporter {
|
||||
isTTY = true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('custom diff config', async () => {
|
||||
const filename = resolve('./fixtures/reporters/custom-diff-config.test.ts')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
import TestReporter from '../../fixtures/reporters/implementations/custom-reporter'
|
||||
|
||||
const reportersDir = resolve(import.meta.dirname, '../../fixtures/reporters/implementations')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { RunnerTask } from 'vitest/node'
|
||||
import { runVitest, runVitestCli, StableTestFileOrderSorter } from '#test-utils'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { DefaultReporter } from 'vitest/node'
|
||||
import { runVitest, runVitestCli, StableTestFileOrderSorter } from '#test-utils'
|
||||
import { trimReporterOutput } from './utils'
|
||||
|
||||
describe('default reporter', async () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
describe.each([true, false])('{ isTTY: %s }', (isTTY) => {
|
||||
test('renders successful tests', async () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('should print logs correctly', async () => {
|
||||
const result = await runVitest({ root: './fixtures/reporters' }, ['error-to-json.test.ts'])
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('should print function name', async () => {
|
||||
const filename = resolve('./fixtures/reporters/function-as-name.test.ts')
|
||||
|
||||
@@ -2,10 +2,10 @@ import { randomUUID } from 'node:crypto'
|
||||
import { access, readFile, rm } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { sep } from 'node:path'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { GithubActionsReporter } from 'vitest/node'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
describe(GithubActionsReporter, () => {
|
||||
it('uses absolute path by default', async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { playwright } from '@vitest/browser-playwright'
|
||||
import { expect, it } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
it('basic', async () => {
|
||||
const result = await runInlineTests({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { stripVTControlCharacters } from 'node:util'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
/**
|
||||
* Extract import durations section and normalize variable values for snapshot testing.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('should print correct indicator position', async () => {
|
||||
const filename = resolve('./fixtures/reporters/indicator-position.test.js')
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
describe('json reporter', async () => {
|
||||
const root = resolve(import.meta.dirname, '..', '..', 'fixtures', 'reporters')
|
||||
const projectRoot = resolve(import.meta.dirname, '..', '..', '..', '..')
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { RunnerTaskResult, RunnerTestCase, RunnerTestFile, RunnerTestSuite, RunnerTask as Task } from 'vitest'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { runVitest, runVitestCli } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { expect, test, TestRunner } from 'vitest'
|
||||
import { rolldownVersion } from 'vitest/node'
|
||||
import { runVitest, runVitestCli } from '#test-utils'
|
||||
|
||||
const root = resolve(import.meta.dirname, '../../fixtures/reporters')
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('cursor is hidden during test run in TTY', async () => {
|
||||
const { stdout } = await runVitest({
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import type { RunVitestConfig } from '#test-utils'
|
||||
import type { RunnerTestFile as File, RunnerTestCase as Test } from 'vitest'
|
||||
import type { TestUserConfig, Vitest } from 'vitest/node'
|
||||
import type { MergeReport } from 'vitest/src/node/reporters/blob.js'
|
||||
import type { RunVitestConfig } from '#test-utils'
|
||||
import { cpSync, existsSync, readdirSync, readFileSync, rmSync } from 'node:fs'
|
||||
import { mkdir, writeFile } from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
import { buildTestTree, runVitest, useFS, useTmpFS } from '#test-utils'
|
||||
import { playwright } from '@vitest/browser-playwright'
|
||||
import { stringify } from 'flatted'
|
||||
import { dirname, resolve } from 'pathe'
|
||||
import { beforeEach, expect, test, TestRunner } from 'vitest'
|
||||
import { version } from 'vitest/package.json'
|
||||
import { getModuleGraph } from 'vitest/src/utils/graph.js'
|
||||
import { buildTestTree, runVitest, useFS, useTmpFS } from '#test-utils'
|
||||
|
||||
// always relative to CWD because it's used only from the CLI,
|
||||
// so we need to correctly resolve it here
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { rmSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { beforeEach, describe, expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
const root = './fixtures/reporters/reporter-error'
|
||||
const reportsDir = resolve(root, '.vitest/blob')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { DefaultReporter } from 'vitest/node'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('{ silent: true } hides all console logs', async () => {
|
||||
const { stdout } = await runVitest({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Renderer } from 'ansivision'
|
||||
import { runVitest, StableTestFileOrderSorter } from '#test-utils'
|
||||
import { renderString } from 'ansivision'
|
||||
import { normalize } from 'pathe'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest, StableTestFileOrderSorter } from '#test-utils'
|
||||
|
||||
test('states of running tests are reported', async () => {
|
||||
const { stdout } = await runVitest({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('handle custom error without name', async () => {
|
||||
let { stdout, stderr } = await runVitest({ reporters: 'tap', root: './fixtures/reporters/custom-error' })
|
||||
|
||||
@@ -13,8 +13,8 @@ import type {
|
||||
} from 'vitest/node'
|
||||
import { rmSync } from 'node:fs'
|
||||
import { resolve, sep } from 'node:path'
|
||||
import { runInlineTests, ts } from '#test-utils'
|
||||
import { describe, expect, onTestFinished, test } from 'vitest'
|
||||
import { runInlineTests, ts } from '#test-utils'
|
||||
|
||||
describe('TestRun', () => {
|
||||
test('pass test run without files (no-watch)', async () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runVitest, StableTestFileOrderSorter } from '#test-utils'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { runVitest, StableTestFileOrderSorter } from '#test-utils'
|
||||
import { trimReporterOutput } from './utils'
|
||||
|
||||
describe('tree reporter', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TestSpecification } from 'vitest/node'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('duration', async () => {
|
||||
const { stdout } = await runVitest({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { RunVitestConfig } from '#test-utils'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { playwright } from '@vitest/browser-playwright'
|
||||
import { expect, it } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
function modeToConfig(mode: string): RunVitestConfig {
|
||||
if (mode === 'playwright') {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { rolldownVersion } from 'vitest/node'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('rollup error node', async () => {
|
||||
const { stderr } = await runVitest({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { CliOptions, TestCase, TestModule, TestSuite } from 'vitest/node'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { expect, onTestFinished, test } from 'vitest'
|
||||
import { createVitest, rolldownVersion } from 'vitest/node'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
test('correctly collects a simple test', async () => {
|
||||
const testModule = await collectTests(`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TestCase, TestSuite } from 'vitest/node'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
test('meta can be defined on test options', async () => {
|
||||
const { stderr, ctx } = await runInlineTests({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TestCase, TestSuite } from 'vitest/node'
|
||||
import { runInlineTests, runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runInlineTests, runVitest } from '#test-utils'
|
||||
|
||||
test('vitest records tags', async () => {
|
||||
const { stderr, buildTree } = await runVitest({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { RunVitestConfig } from '#test-utils'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
describe('dangerouslyIgnoreUnhandledErrors', () => {
|
||||
test('{ dangerouslyIgnoreUnhandledErrors: true }', async () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import crypto from 'node:crypto'
|
||||
import { runInlineTests, useFS } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { expect, onTestFinished, test, vi } from 'vitest'
|
||||
import { createVitest } from 'vitest/node'
|
||||
import { runInlineTests, useFS } from '#test-utils'
|
||||
|
||||
test('custom vcsProvider that returns specific files runs only matching tests', async () => {
|
||||
const { testTree, stderr } = await runInlineTests({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
test('reruns tests when config changes', async () => {
|
||||
const { vitest, ctx } = await runInlineTests({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { existsSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import * as testUtils from '#test-utils'
|
||||
|
||||
import { playwright } from '@vitest/browser-playwright'
|
||||
|
||||
import { afterEach, describe, expect, onTestFinished, test } from 'vitest'
|
||||
import * as testUtils from '#test-utils'
|
||||
|
||||
const sourceFile = 'fixtures/watch/math.ts'
|
||||
const sourceFileContent = readFileSync(sourceFile, 'utf-8')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { editFile, runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { editFile, runVitest } from '#test-utils'
|
||||
|
||||
const testFile = 'fixtures/watch/math.test.ts'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { editFile, runVitest } from '#test-utils'
|
||||
import { resolve } from 'pathe'
|
||||
import { test } from 'vitest'
|
||||
import { editFile, runVitest } from '#test-utils'
|
||||
|
||||
test('when nothing is changed, run nothing but keep watching', async () => {
|
||||
const { vitest } = await runVitest({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
describe.for([
|
||||
true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runVitest } from '#test-utils'
|
||||
import { expect, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
// chokidar regularly delivers several change events for one config edit, each
|
||||
// triggering a restart. A restart that begins while another is still
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
const ts = String.raw
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { readFileSync, writeFileSync } from 'node:fs'
|
||||
import { runVitest } from '#test-utils'
|
||||
import { afterEach, test } from 'vitest'
|
||||
import { runVitest } from '#test-utils'
|
||||
|
||||
const testFile = 'fixtures/watch/math.test.ts'
|
||||
const testFileContent = readFileSync(testFile, 'utf-8')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { runInlineTests } from '#test-utils'
|
||||
import { expect, it } from 'vitest'
|
||||
import { runInlineTests } from '#test-utils'
|
||||
|
||||
const dynamicTestContent = `// Dynamic test added by test/watch/workspaces.test.ts
|
||||
import { expect, test } from "vitest";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as testUtils from '#test-utils'
|
||||
import { describe, expect, test, vi } from 'vitest'
|
||||
import { getWorkersCountByPercentage } from 'vitest/src/utils/workers.js'
|
||||
import * as testUtils from '#test-utils'
|
||||
|
||||
vi.mock(import('node:os'), async importOriginal => ({
|
||||
...(await importOriginal()),
|
||||
|
||||
Reference in New Issue
Block a user