From bac2ef7c7418488f88d9b6249331c6cb3c50ba8f Mon Sep 17 00:00:00 2001 From: Joao Victor Piga Lopes Date: Wed, 8 Jan 2025 20:14:04 -0300 Subject: [PATCH] fix: move tests for filterWorkspaces for watch folder --- test/filterWatchMode/README.md | 5 ----- test/filterWatchMode/package.json | 18 ------------------ test/filterWatchMode/tsconfig.json | 13 ------------- test/filterWatchMode/vitest.workspace.ts | 1 - .../filterWorkspaces}/client/some.test.ts | 0 .../filterWorkspaces}/server/some.test.ts | 0 .../filterWorkspaces}/shared/some.test.ts | 0 .../vitest.config.browser.ts | 2 +- .../vitest.config.node.ts | 2 +- test/watch/vitest.workspace.ts | 1 + 10 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 test/filterWatchMode/README.md delete mode 100644 test/filterWatchMode/package.json delete mode 100644 test/filterWatchMode/tsconfig.json delete mode 100644 test/filterWatchMode/vitest.workspace.ts rename test/{filterWatchMode/src => watch/fixtures/filterWorkspaces}/client/some.test.ts (100%) rename test/{filterWatchMode/src => watch/fixtures/filterWorkspaces}/server/some.test.ts (100%) rename test/{filterWatchMode/src => watch/fixtures/filterWorkspaces}/shared/some.test.ts (100%) rename test/{filterWatchMode => watch}/vitest.config.browser.ts (53%) rename test/{filterWatchMode => watch}/vitest.config.node.ts (52%) create mode 100644 test/watch/vitest.workspace.ts diff --git a/test/filterWatchMode/README.md b/test/filterWatchMode/README.md deleted file mode 100644 index c5d6649dd05d..000000000000 --- a/test/filterWatchMode/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Vitest Demo - -Run `pnpm test` and change a test or source code to see HMR in action! - -Learn more at https://vitest.dev diff --git a/test/filterWatchMode/package.json b/test/filterWatchMode/package.json deleted file mode 100644 index 24787fa2d947..000000000000 --- a/test/filterWatchMode/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@vitest/filter-watch-mode", - "type": "module", - "private": true, - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "vitest", - "test:dev": "vitest --watch", - "test:ui": "vitest --ui", - "test:run": "vitest run" - }, - "devDependencies": { - "@vitest/ui": "workspace:*", - "vite": "latest", - "vitest": "workspace:*" - } -} diff --git a/test/filterWatchMode/tsconfig.json b/test/filterWatchMode/tsconfig.json deleted file mode 100644 index 1d25015762c3..000000000000 --- a/test/filterWatchMode/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "target": "es2020", - "module": "node16", - "strict": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "verbatimModuleSyntax": true - }, - "include": ["src", "test"], - "exclude": ["node_modules"] -} diff --git a/test/filterWatchMode/vitest.workspace.ts b/test/filterWatchMode/vitest.workspace.ts deleted file mode 100644 index 8f9fdfd58a94..000000000000 --- a/test/filterWatchMode/vitest.workspace.ts +++ /dev/null @@ -1 +0,0 @@ -export default ['vitest.config.browser.ts', 'vitest.config.node.ts'] diff --git a/test/filterWatchMode/src/client/some.test.ts b/test/watch/fixtures/filterWorkspaces/client/some.test.ts similarity index 100% rename from test/filterWatchMode/src/client/some.test.ts rename to test/watch/fixtures/filterWorkspaces/client/some.test.ts diff --git a/test/filterWatchMode/src/server/some.test.ts b/test/watch/fixtures/filterWorkspaces/server/some.test.ts similarity index 100% rename from test/filterWatchMode/src/server/some.test.ts rename to test/watch/fixtures/filterWorkspaces/server/some.test.ts diff --git a/test/filterWatchMode/src/shared/some.test.ts b/test/watch/fixtures/filterWorkspaces/shared/some.test.ts similarity index 100% rename from test/filterWatchMode/src/shared/some.test.ts rename to test/watch/fixtures/filterWorkspaces/shared/some.test.ts diff --git a/test/filterWatchMode/vitest.config.browser.ts b/test/watch/vitest.config.browser.ts similarity index 53% rename from test/filterWatchMode/vitest.config.browser.ts rename to test/watch/vitest.config.browser.ts index e9b249c92039..203806b91460 100644 --- a/test/filterWatchMode/vitest.config.browser.ts +++ b/test/watch/vitest.config.browser.ts @@ -3,6 +3,6 @@ import { defineProject } from 'vitest/config' export default defineProject({ test: { name: 'browser', - include: ['src/client/**/*.ts', 'src/shared/**/*.ts'], + include: ['fixtures/filterWorkspaces/client/**/*.ts', 'fixtures/filterWorkspaces/shared/**/*.ts'], }, }) diff --git a/test/filterWatchMode/vitest.config.node.ts b/test/watch/vitest.config.node.ts similarity index 52% rename from test/filterWatchMode/vitest.config.node.ts rename to test/watch/vitest.config.node.ts index 742aa3dd5327..73bebd4f5107 100644 --- a/test/filterWatchMode/vitest.config.node.ts +++ b/test/watch/vitest.config.node.ts @@ -3,6 +3,6 @@ import { defineProject } from 'vitest/config' export default defineProject({ test: { name: 'node', - include: ['src/server/**/*.ts', 'src/shared/**/*.ts'], + include: ['fixtures/filterWorkspaces/server/**/*.ts', 'fixtures/filterWorkspaces/shared/**/*.ts'], }, }) diff --git a/test/watch/vitest.workspace.ts b/test/watch/vitest.workspace.ts new file mode 100644 index 000000000000..15d2daccf80d --- /dev/null +++ b/test/watch/vitest.workspace.ts @@ -0,0 +1 @@ +export default ['vitest.config.ts', 'vitest.config.browser.ts', 'vitest.config.node.ts']