From 371c8e3179d0092973fdba4aa86c2bccebd142ed Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 9 Feb 2026 15:59:58 +0100 Subject: [PATCH] feat: remove `experimentalStaticAstCollect` from Vitest 3 support (#733) --- .github/workflows/ci.yml | 66 +++++++++++++++++---- README.md | 5 -- package.json | 7 +-- packages/extension/src/api/ws.ts | 4 +- packages/extension/src/config.ts | 3 - packages/extension/src/constants.ts | 1 - packages/extension/src/extension.ts | 1 - packages/shared/src/index.ts | 2 - packages/worker-legacy/src/collect.ts | 22 +++++-- packages/worker-legacy/src/index.ts | 2 - packages/worker-legacy/src/setupFile.ts | 33 ----------- packages/worker-legacy/src/types.ts | 11 ---- packages/worker-legacy/src/watcher.ts | 30 +--------- packages/worker-legacy/src/worker.ts | 39 ++---------- pnpm-lock.yaml | 16 ++--- samples/ast-collector/.vscode/settings.json | 1 - samples/basic-v4/.vscode/settings.json | 1 - samples/basic/.vscode/settings.json | 1 - test/e2e/vitest.config.ts | 1 + tsup.config.ts | 5 -- 20 files changed, 87 insertions(+), 164 deletions(-) delete mode 100644 packages/worker-legacy/src/setupFile.ts delete mode 100644 packages/worker-legacy/src/types.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01718f6..ba783fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,25 @@ on: branches: [main] jobs: - ci: + lint: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: pnpm + + - run: pnpm install --filter="vitest-vscode-*" --frozen-lockfile + - run: pnpm build + - run: pnpm typecheck + - run: pnpm lint + + test: runs-on: ${{ matrix.os }} strategy: @@ -27,27 +45,51 @@ jobs: - run: pnpm install --frozen-lockfile - run: pnpm build - - run: pnpm typecheck - - run: pnpm lint - name: test - run: | - pnpm test + run: pnpm test - name: test-e2e - run: pnpm test-e2e --retry 2 + run: pnpm test-e2e + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: 'test-results-${{ matrix.os }}' + path: 'test-results/${{ matrix.os }}' + + test-legacy: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-latest, windows-latest] + node-version: [22.x] + + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: pnpm - name: vitest 3.2 run: node ./scripts/lower-vitest-version.js - - run: pnpm install --no-frozen-lockfile - - name: test-e2e-legacy - run: pnpm test-e2e --retry 2 - env: - TEST_LEGACY: true + - run: pnpm install --prefer-offline --no-frozen-lockfile + - run: pnpm build + + - name: test + run: pnpm test + + - name: test-e2e + run: pnpm test-e2e:legacy - uses: actions/upload-artifact@v4 if: always() with: - name: 'test-results-${{ matrix.os }}' + name: 'test-results-legacy-${{ matrix.os }}' path: 'test-results/${{ matrix.os }}' diff --git a/README.md b/README.md index cafcef3..9af7a9f 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,6 @@ These options are resolved relative to the [workspace file](https://code.visuals - `vitest.logLevel`: How verbose should the logger be in the "Output" channel. Default: `info` - `vitest.applyDiagnostic`: Show a squiggly line where the error was thrown. This also enables the error count in the File Tab. Default: `true` - `vitest.showInlineConsoleLog`: Show console.log messages inline in the editor next to the code that produced them. When disabled, console logs will still appear in the test output but not inline. Default: `true` -- `vitest.experimentalStaticAstCollect`: uses AST parses to collect tests instead of running files and collecting them at runtime. Default: `true` ### Commands @@ -127,10 +126,6 @@ If you hover over it, you can get a more detailed diagnostic. You can disable this feature by turning off `vitest.showImportsDuration`. -### Experimental - -If the extension hangs, consider enabling `vitest.experimentalStaticAstCollect` option to use static analysis instead of actually running the test file every time you make a change which can cause visible hangs if it takes a long time to setup the test. - ## FAQs (Frequently Asked Questions) ### How can I use it in monorepo? diff --git a/package.json b/package.json index b9f2165..52650b4 100644 --- a/package.json +++ b/package.json @@ -294,12 +294,6 @@ "type": "array", "scope": "resource" }, - "vitest.experimentalStaticAstCollect": { - "markdownDescription": "Enable static AST analysis for faster test discovery. This feature is experimental and may not work with all projects.", - "type": "boolean", - "default": true, - "scope": "resource" - }, "vitest.cliArguments": { "markdownDescription": "Additional arguments to pass to the Vitest CLI. Note that some arguments will be ignored: `watch`, `reporter`, `api`, and `ui`. Example: `--mode=staging`.", "type": "string", @@ -335,6 +329,7 @@ "test": "vscode-test", "test:watch": "vscode-test --watch-files src/**/*.ts --watch-files test/**/*.test.ts", "test-e2e": "vitest --root test/e2e", + "test-e2e:legacy": "TEST_LEGACY=true vitest --root test/e2e", "ecosystem-ci:build": "pnpm build", "ecosystem-ci:test": "tsx ./scripts/ecosystem-ci.mts", "typecheck": "tsc -b ./ --noEmit", diff --git a/packages/extension/src/api/ws.ts b/packages/extension/src/api/ws.ts index 2f02756..7fd83a6 100644 --- a/packages/extension/src/api/ws.ts +++ b/packages/extension/src/api/ws.ts @@ -6,7 +6,7 @@ import { pathToFileURL } from 'node:url' import { gte } from 'semver' import vscode from 'vscode' import { getConfig } from '../config' -import { browserSetupFilePath, finalCoverageFileName, setupFilePath } from '../constants' +import { browserSetupFilePath, finalCoverageFileName } from '../constants' import { log } from '../log' import { createVitestRpc } from './rpc' @@ -131,13 +131,11 @@ export function onWsConnection( ? pathToFileURL(pnpLoader).toString() : undefined, setupFilePaths: { - watcher: setupFilePath, browserDebug: browserSetupFilePath, }, finalCoverageFileName, }, debug, - astCollect: getConfig(pkg.folder).experimentalStaticAstCollect, } ws.send(JSON.stringify(runnerOptions)) diff --git a/packages/extension/src/config.ts b/packages/extension/src/config.ts index f55554c..160f740 100644 --- a/packages/extension/src/config.ts +++ b/packages/extension/src/config.ts @@ -65,8 +65,6 @@ export function getConfig(workspaceFolder?: WorkspaceFolder) { const shellType = get<'child_process' | 'terminal'>('shellType', 'child_process')! const nodeExecArgs = get('nodeExecArgs') - const experimentalStaticAstCollect = get('experimentalStaticAstCollect', false)! - const cliArguments = get('cliArguments') const debugOutFiles = get('debugOutFiles', []) @@ -86,7 +84,6 @@ export function getConfig(workspaceFolder?: WorkspaceFolder) { applyDiagnostic, cliArguments, nodeExecArgs, - experimentalStaticAstCollect, vitestPackagePath: resolvedVitestPackagePath, workspaceConfig: resolveConfigPath(workspaceConfig), rootConfig: resolveConfigPath(rootConfigFile), diff --git a/packages/extension/src/constants.ts b/packages/extension/src/constants.ts index a1d66b6..aaaec52 100644 --- a/packages/extension/src/constants.ts +++ b/packages/extension/src/constants.ts @@ -6,7 +6,6 @@ export const minimumNodeVersion = '18.0.0' export const distDir = __dirname export const workerPath = resolve(__dirname, 'worker.js') -export const setupFilePath = resolve(__dirname, 'setupFile.mjs') export const browserSetupFilePath = resolve(__dirname, 'browserSetupFile.mjs') export const configGlob = '**/*{vite,vitest}*.config*.{ts,js,mjs,cjs,cts,mts}' diff --git a/packages/extension/src/extension.ts b/packages/extension/src/extension.ts index fd7644d..237dc87 100644 --- a/packages/extension/src/extension.ts +++ b/packages/extension/src/extension.ts @@ -306,7 +306,6 @@ class VitestExtension { 'vitest.terminalShellArgs', 'vitest.terminalShellPath', 'vitest.filesWatcherInclude', - 'vitest.experimentalStaticAstCollect', 'vitest.cliArguments', ] diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 8bfca6e..430f50e 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -143,7 +143,6 @@ export interface WorkerInitMetadata { pnpApi?: string pnpLoader?: string setupFilePaths: { - watcher: string browserDebug: string } finalCoverageFileName: string @@ -159,7 +158,6 @@ export interface WorkerRunnerOptions { type: 'init' meta: WorkerInitMetadata debug?: WorkerRunnerDebugOptions | boolean - astCollect: boolean } export interface SerializedProject { diff --git a/packages/worker-legacy/src/collect.ts b/packages/worker-legacy/src/collect.ts index 53d97de..074b195 100644 --- a/packages/worker-legacy/src/collect.ts +++ b/packages/worker-legacy/src/collect.ts @@ -60,6 +60,14 @@ const verbose = process.env.VITEST_VSCODE_LOG === 'verbose' } : undefined +function isTestFunctionName(name: string) { + return name === 'it' || name === 'test' || name.startsWith('test') || name.endsWith('Test') +} + +function isVitestFunctionName(name: string) { + return name === 'describe' || name === 'suite' || isTestFunctionName(name) +} + export function astParseFile(filepath: string, code: string) { const ast = parse(code, { ecmaVersion: 'latest', @@ -95,7 +103,7 @@ export function astParseFile(filepath: string, code: string) { if (callee.type === 'MemberExpression') { if ( callee.object?.type === 'Identifier' - && ['it', 'test', 'describe', 'suite'].includes(callee.object.name) + && isVitestFunctionName(callee.object.name) ) { return callee.object?.name } @@ -128,14 +136,14 @@ export function astParseFile(filepath: string, code: string) { if (!name) { return } - if (!['it', 'test', 'describe', 'suite'].includes(name)) { + if (!isVitestFunctionName(name)) { verbose?.(`Skipping ${name} (unknown call)`) return } const property = callee?.property?.name let mode = !property || property === name ? 'run' : property // they will be picked up in the next iteration - if (['each', 'for', 'skipIf', 'runIf'].includes(mode)) { + if (['each', 'for', 'skipIf', 'runIf', 'extend', 'scoped'].includes(mode)) { return } @@ -173,8 +181,10 @@ export function astParseFile(filepath: string, code: string) { } message = message - // Vite SSR injects these - .replace(/__vite_ssr_import_\d+__\./g, '') + // vite 7+ + .replace(/\(0\s?,\s?__vite_ssr_import_\d+__.(\w+)\)/g, '$1') + // vite <7 + .replace(/__(vite_ssr_import|vi_import)_\d+__\./g, '') // Vitest module mocker injects these .replace(/__vi_import_\d+__\./g, '') @@ -195,7 +205,7 @@ export function astParseFile(filepath: string, code: string) { start, end, name: message, - type: name === 'it' || name === 'test' ? 'test' : 'suite', + type: isTestFunctionName(name) ? 'test' : 'suite', mode, task: null as any, dynamic: isDynamicEach, diff --git a/packages/worker-legacy/src/index.ts b/packages/worker-legacy/src/index.ts index c00727a..babdd77 100644 --- a/packages/worker-legacy/src/index.ts +++ b/packages/worker-legacy/src/index.ts @@ -15,7 +15,6 @@ export async function initVitest( typeof data.debug === 'object' && data.debug.browser ? meta.setupFilePaths.browserDebug : null, - meta.setupFilePaths.watcher, ].filter(v => v != null), }) @@ -165,7 +164,6 @@ export async function initVitest( return new ExtensionWorker( vitest, !!data.debug, - data.astCollect, emitter, data.meta.finalCoverageFileName, ) diff --git a/packages/worker-legacy/src/setupFile.ts b/packages/worker-legacy/src/setupFile.ts deleted file mode 100644 index d458895..0000000 --- a/packages/worker-legacy/src/setupFile.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { WorkerGlobalState } from 'vitest' -import { inject } from 'vitest' - -const { watchEveryFile, continuousFiles, rerunTriggered } = inject('__vscode') -// @ts-expect-error injected global -const workerState = globalThis.__vitest_worker__ as WorkerGlobalState - -const testFile = workerState.filepath! - -assert(testFile, 'Expected workerState.filepath to be set') - -// don't run tests that are not watched if rerun was triggered - only collect those tests -if (rerunTriggered) { - if (!watchEveryFile && !testFileWatched()) - // eslint-disable-next-line regexp/no-useless-assertions - workerState.config.testNamePattern = /$a/ -} - -function testFileWatched() { - return continuousFiles.some((file) => { - if (file === testFile) - return true - if (file[file.length - 1] === '/') - return testFile.startsWith(file) - return false - }) -} - -function assert(condition: unknown, message: string | (() => string)): asserts condition { - if (!condition) { - throw new Error(typeof message === 'string' ? message : message()) - } -} diff --git a/packages/worker-legacy/src/types.ts b/packages/worker-legacy/src/types.ts deleted file mode 100644 index cec0bb2..0000000 --- a/packages/worker-legacy/src/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare module 'vitest' { - export interface ProvidedContext { - __vscode: { - continuousFiles: string[] - watchEveryFile: boolean - rerunTriggered: boolean - } - } -} - -export {} diff --git a/packages/worker-legacy/src/watcher.ts b/packages/worker-legacy/src/watcher.ts index 2cbc8a1..6901415 100644 --- a/packages/worker-legacy/src/watcher.ts +++ b/packages/worker-legacy/src/watcher.ts @@ -1,4 +1,3 @@ -import type { ProvidedContext } from 'vitest' import type { WorkspaceProject } from 'vitest/node' import { relative } from 'pathe' import { ExtensionWorker } from './worker' @@ -7,7 +6,6 @@ export class ExtensionWorkerWatcher { private files: string[] = [] private testNamePattern: string | undefined private watchEveryFile = false - private rerunTriggered = false private enabled = false @@ -15,17 +13,6 @@ export class ExtensionWorkerWatcher { // eslint-disable-next-line ts/no-this-alias const state = this const vitest = worker.vitest - ;(worker.getRootTestProject().provide as (key: T, value: ProvidedContext[T]) => void)('__vscode', { - get continuousFiles() { - return state.files || [] - }, - get watchEveryFile() { - return state.watchEveryFile ?? true - }, - get rerunTriggered() { - return state.rerunTriggered ?? false - }, - }) // @ts-expect-error modifying a private property const originalScheduleRerun = vitest.scheduleRerun.bind(vitest) @@ -41,7 +28,7 @@ export class ExtensionWorkerWatcher { if (!isTestFileTrigger) { this.changedTests.clear() this.invalidates.clear() - return await originalScheduleRerun.call(this, files) + return await originalScheduleRerun.call(this, []) } const tests = Array.from(this.changedTests) @@ -49,9 +36,7 @@ export class ExtensionWorkerWatcher { const astSpecs: [project: WorkspaceProject, file: string][] = [] for (const [project, file] of specs) { - if (worker.alwaysAstCollect || project.config.browser.enabled) { - astSpecs.push([project, file]) - } + astSpecs.push([project, file]) } worker.setGlobalTestNamePattern(ExtensionWorker.COLLECT_NAME_PATTERN) @@ -63,12 +48,9 @@ export class ExtensionWorkerWatcher { this.changedTests.clear() return await originalScheduleRerun.call(this, []) } - - return await originalScheduleRerun.call(this, files) + return await originalScheduleRerun.call(this, []) } - state.rerunTriggered = true - const namePattern = state.testNamePattern ? new RegExp(state.testNamePattern) : undefined worker.setGlobalTestNamePattern(namePattern) if (state.watchEveryFile) { @@ -115,16 +97,11 @@ export class ExtensionWorkerWatcher { }) } - markRerun(rerun: boolean) { - this.rerunTriggered = rerun - } - trackTests(files: string[], testNamePatern: string | undefined) { this.enabled = true this.files = files this.watchEveryFile = false this.testNamePattern = testNamePatern - this.rerunTriggered = false } trackEveryFile() { @@ -132,7 +109,6 @@ export class ExtensionWorkerWatcher { this.watchEveryFile = true this.files = [] this.testNamePattern = undefined - this.rerunTriggered = false } stopTracking() { diff --git a/packages/worker-legacy/src/worker.ts b/packages/worker-legacy/src/worker.ts index e2f3c81..976dce3 100644 --- a/packages/worker-legacy/src/worker.ts +++ b/packages/worker-legacy/src/worker.ts @@ -33,7 +33,6 @@ export class ExtensionWorker implements ExtensionWorkerTransport { constructor( public readonly vitest: VitestCore, private readonly debug = false, - public readonly alwaysAstCollect = false, private emitter: WorkerWSEventEmitter, finalCoverageFileName: string, ) { @@ -76,44 +75,17 @@ export class ExtensionWorker implements ExtensionWorkerTransport { } public async collectTests(files: [projectName: string, filepath: string][]) { - const astCollect: [project: WorkspaceProject, filepath: string][] = [] - const otherTests: [project: WorkspaceProject, filepath: string][] = [] + const specifications: [project: WorkspaceProject, filepath: string][] = [] for (const [projectName, filepath] of files) { const project = this.vitest.projects.find(project => project.getName() === projectName) assert(project, `Project ${projectName} not found for file ${filepath}`) - if (this.alwaysAstCollect || project.config.browser.enabled) { - astCollect.push([project, filepath]) - } - else { - otherTests.push([project, filepath]) - } + specifications.push([project, filepath]) } - await Promise.all([ - (async () => { - if (astCollect.length) { - await this.astCollect(astCollect) - } - })(), - (async () => { - if (otherTests.length) { - const files = otherTests.map( - ([project, filepath]) => [ - project.getName(), - filepath, - ] as const, - ) - - try { - await this.runTestFiles(files, ExtensionWorker.COLLECT_NAME_PATTERN) - } - finally { - this.setTestNamePattern(undefined) - } - } - })(), - ]) + if (specifications.length) { + await this.astCollect(specifications) + } } public async astCollect(specs: [project: WorkspaceProject, file: string][]) { @@ -230,7 +202,6 @@ export class ExtensionWorker implements ExtensionWorkerTransport { private async runTestFiles(specs: ExtensionTestSpecification[], testNamePattern?: string | undefined, runAllFiles = false) { await (this.vitest as any).runningPromise - this.watcher.markRerun(false) this.setTestNamePattern(testNamePattern) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32c2859..d06f3c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2894,10 +2894,6 @@ packages: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} - expect-type@1.2.2: - resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==} - engines: {node: '>=12.0.0'} - expect-type@1.3.0: resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} engines: {node: '>=12.0.0'} @@ -3098,21 +3094,23 @@ packages: glob@10.5.0: resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me hasBin: true glob@11.1.0: resolution: {integrity: sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==} engines: {node: 20 || >=22} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me hasBin: true glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} - deprecated: Glob versions prior to v9 are no longer supported + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} @@ -6605,7 +6603,7 @@ snapshots: sirv: 3.0.2 tinyrainbow: 2.0.0 vitest: 3.2.4(@types/debug@4.1.12)(@types/node@24.10.1)(@vitest/browser@3.2.4)(happy-dom@15.11.7)(jiti@2.6.1)(jsdom@28.0.0)(tsx@4.21.0)(yaml@2.8.2) - ws: 8.18.3 + ws: 8.19.0 optionalDependencies: playwright: 1.57.0 transitivePeerDependencies: @@ -8111,8 +8109,6 @@ snapshots: expand-template@2.0.3: optional: true - expect-type@1.2.2: {} - expect-type@1.3.0: {} exsolve@1.0.8: {} @@ -10629,7 +10625,7 @@ snapshots: '@vitest/utils': 3.2.4 chai: 5.3.3 debug: 4.4.3(supports-color@8.1.1) - expect-type: 1.2.2 + expect-type: 1.3.0 magic-string: 0.30.21 pathe: 2.0.3 picomatch: 4.0.3 diff --git a/samples/ast-collector/.vscode/settings.json b/samples/ast-collector/.vscode/settings.json index 03a29fe..67bacdc 100644 --- a/samples/ast-collector/.vscode/settings.json +++ b/samples/ast-collector/.vscode/settings.json @@ -2,7 +2,6 @@ "vitest.nodeEnv": { "TEST_CUSTOM_ENV": "hello" }, - "vitest.experimentalStaticAstCollect": true, "[typescript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" }, diff --git a/samples/basic-v4/.vscode/settings.json b/samples/basic-v4/.vscode/settings.json index 4d78eae..06c486e 100644 --- a/samples/basic-v4/.vscode/settings.json +++ b/samples/basic-v4/.vscode/settings.json @@ -2,7 +2,6 @@ "vitest.nodeEnv": { "TEST_CUSTOM_ENV": "hello" }, - "vitest.experimentalStaticAstCollect": true, "[typescript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" }, diff --git a/samples/basic/.vscode/settings.json b/samples/basic/.vscode/settings.json index 0842d6a..53d6bf6 100644 --- a/samples/basic/.vscode/settings.json +++ b/samples/basic/.vscode/settings.json @@ -2,7 +2,6 @@ "vitest.nodeEnv": { "TEST_CUSTOM_ENV": "hello" }, - "vitest.experimentalStaticAstCollect": true, "[typescript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" } diff --git a/test/e2e/vitest.config.ts b/test/e2e/vitest.config.ts index 6f73886..71cff0e 100644 --- a/test/e2e/vitest.config.ts +++ b/test/e2e/vitest.config.ts @@ -15,5 +15,6 @@ export default defineConfig({ globalSetup: [ './utils/downloadSetup.ts', ], + retry: process.env.CI ? 2 : 0, }, }) diff --git a/tsup.config.ts b/tsup.config.ts index 6211ec7..7f4f75c 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -27,11 +27,6 @@ export default defineConfig([ }, format: 'cjs', }, - { - entry: ['./packages/worker-legacy/src/setupFile.ts'], - external: ['vitest'], - format: 'esm', - }, { entry: ['./packages/extension/src/worker/browserSetupFile.ts'], external: ['vitest', '@vitest/browser/context'], -- 2.51.2