[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

fix!: remove deprecated APIs (#8428)

authored by

Vladimir and committed by
GitHub
(Aug 12, 2025, 6:25 PM +0200) a1cb9719 e69d8f4e

+146 -434
+64 -97
pnpm-lock.yaml
··· 6 6 7 7 catalogs: 8 8 default: 9 + '@iconify-json/carbon': 10 + specifier: ^1.2.11 11 + version: 1.2.11 12 + '@iconify-json/logos': 13 + specifier: ^1.2.5 14 + version: 1.2.5 15 + '@jridgewell/trace-mapping': 16 + specifier: ^0.3.29 17 + version: 0.3.29 9 18 '@types/chai': 10 19 specifier: ^5.2.2 11 20 version: 5.2.2 ··· 18 27 '@types/istanbul-lib-coverage': 19 28 specifier: ^2.0.6 20 29 version: 2.0.6 30 + '@types/istanbul-lib-report': 31 + specifier: ^3.0.3 32 + version: 3.0.3 33 + '@types/istanbul-lib-source-maps': 34 + specifier: ^4.0.4 35 + version: 4.0.4 21 36 '@types/istanbul-reports': 22 37 specifier: ^3.0.4 23 38 version: 3.0.4 39 + '@types/ws': 40 + specifier: ^8.18.1 41 + version: 8.18.1 42 + '@unocss/reset': 43 + specifier: ^66.3.3 44 + version: 66.3.3 45 + '@vitejs/plugin-vue': 46 + specifier: ^6.0.1 47 + version: 6.0.1 48 + '@vueuse/core': 49 + specifier: ^12.8.2 50 + version: 12.8.2 24 51 acorn-walk: 25 52 specifier: ^8.3.4 26 53 version: 8.3.4 ··· 39 66 flatted: 40 67 specifier: ^3.3.3 41 68 version: 3.3.3 69 + istanbul-lib-coverage: 70 + specifier: ^3.2.2 71 + version: 3.2.2 72 + istanbul-lib-report: 73 + specifier: ^3.0.1 74 + version: 3.0.1 75 + istanbul-lib-source-maps: 76 + specifier: ^5.0.6 77 + version: 5.0.6 78 + istanbul-reports: 79 + specifier: ^3.1.7 80 + version: 3.1.7 42 81 magic-string: 43 82 specifier: ^0.30.17 44 83 version: 0.30.17 84 + magicast: 85 + specifier: ^0.3.5 86 + version: 0.3.5 87 + msw: 88 + specifier: ^2.10.4 89 + version: 2.10.4 45 90 pathe: 46 91 specifier: ^2.0.3 47 92 version: 2.0.3 93 + sirv: 94 + specifier: ^3.0.1 95 + version: 3.0.1 48 96 std-env: 49 97 specifier: ^3.9.0 50 98 version: 3.9.0 ··· 57 105 tinyrainbow: 58 106 specifier: ^2.0.0 59 107 version: 2.0.0 108 + unocss: 109 + specifier: ^66.3.3 110 + version: 66.3.3 111 + unplugin-vue-components: 112 + specifier: ^0.28.0 113 + version: 0.28.0 114 + vue: 115 + specifier: ^3.5.18 116 + version: 3.5.18 60 117 ws: 61 118 specifier: ^8.18.3 62 119 version: 8.18.3 ··· 1083 1140 '@vitest/cjs-lib': 1084 1141 specifier: link:./cjs-lib 1085 1142 version: link:cjs-lib 1086 - '@vitest/injected-lib': 1087 - specifier: link:./injected-lib 1088 - version: link:injected-lib 1089 1143 playwright: 1090 1144 specifier: ^1.54.1 1091 1145 version: 1.54.1 ··· 2804 2858 '@types/node': 2805 2859 optional: true 2806 2860 2807 - '@inquirer/confirm@5.1.13': 2808 - resolution: {integrity: sha512-EkCtvp67ICIVVzjsquUiVSd+V5HRGOGQfsqA4E4vMWhYnB7InUL0pa0TIWt1i+OfP16Gkds8CdIu6yGZwOM1Yw==} 2809 - engines: {node: '>=18'} 2810 - peerDependencies: 2811 - '@types/node': '>=18' 2812 - peerDependenciesMeta: 2813 - '@types/node': 2814 - optional: true 2815 - 2816 2861 '@inquirer/confirm@5.1.14': 2817 2862 resolution: {integrity: sha512-5yR4IBfe0kXe59r1YCTG8WXkUbl7Z35HK87Sw+WUyGD8wNUx7JvY7laahzeytyE1oLn74bQnL7hstctQxisQ8Q==} 2818 - engines: {node: '>=18'} 2819 - peerDependencies: 2820 - '@types/node': '>=18' 2821 - peerDependenciesMeta: 2822 - '@types/node': 2823 - optional: true 2824 - 2825 - '@inquirer/core@10.1.14': 2826 - resolution: {integrity: sha512-Ma+ZpOJPewtIYl6HZHZckeX1STvDnHTCB2GVINNUlSEn2Am6LddWwfPkIGY0IUFVjUUrr/93XlBwTK6mfLjf0A==} 2827 2863 engines: {node: '>=18'} 2828 2864 peerDependencies: 2829 2865 '@types/node': '>=18' ··· 2857 2893 peerDependenciesMeta: 2858 2894 '@types/node': 2859 2895 optional: true 2860 - 2861 - '@inquirer/figures@1.0.12': 2862 - resolution: {integrity: sha512-MJttijd8rMFcKJC8NYmprWr6hD3r9Gd9qUC0XwPNwoEPWSMVJwA2MlXxF+nhZZNMY+HXsWa+o7KY2emWYIn0jQ==} 2863 - engines: {node: '>=18'} 2864 2896 2865 2897 '@inquirer/figures@1.0.13': 2866 2898 resolution: {integrity: sha512-lGPVU3yO9ZNqA7vTYz26jny41lE7yoQansmqdMLBEfqaGsmdg7V3W9mK9Pvb5IL4EVZ9GnSDGMO/cJXud5dMaw==} ··· 2922 2954 2923 2955 '@inquirer/select@4.3.1': 2924 2956 resolution: {integrity: sha512-Gfl/5sqOF5vS/LIrSndFgOh7jgoe0UXEizDqahFRkq5aJBLegZ6WjuMh/hVEJwlFQjyLq1z9fRtvUMkb7jM1LA==} 2925 - engines: {node: '>=18'} 2926 - peerDependencies: 2927 - '@types/node': '>=18' 2928 - peerDependenciesMeta: 2929 - '@types/node': 2930 - optional: true 2931 - 2932 - '@inquirer/type@3.0.7': 2933 - resolution: {integrity: sha512-PfunHQcjwnju84L+ycmcMKB/pTPIngjUJvfnRhKY6FKPuYXlM4aQCb/nIdTFR6BEhMjFvngzvng/vBAJMZpLSA==} 2934 2957 engines: {node: '>=18'} 2935 2958 peerDependencies: 2936 2959 '@types/node': '>=18' ··· 4295 4318 '@volar/typescript@1.11.1': 4296 4319 resolution: {integrity: sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ==} 4297 4320 4298 - '@vue/compiler-core@3.5.17': 4299 - resolution: {integrity: sha512-Xe+AittLbAyV0pabcN7cP7/BenRBNcteM4aSDCtRvGw0d9OL+HG1u/XHLY/kt1q4fyMeZYXyIYrsHuPSiDPosA==} 4300 - 4301 4321 '@vue/compiler-core@3.5.18': 4302 4322 resolution: {integrity: sha512-3slwjQrrV1TO8MoXgy3aynDQ7lslj5UqDxuHnrzHtpON5CBinhWjJETciPngpin/T3OuW3tXUf86tEurusnztw==} 4303 - 4304 - '@vue/compiler-dom@3.5.17': 4305 - resolution: {integrity: sha512-+2UgfLKoaNLhgfhV5Ihnk6wB4ljyW1/7wUIog2puUqajiC29Lp5R/IKDdkebh9jTbTogTbsgB+OY9cEWzG95JQ==} 4306 4323 4307 4324 '@vue/compiler-dom@3.5.18': 4308 4325 resolution: {integrity: sha512-RMbU6NTU70++B1JyVJbNbeFkK+A+Q7y9XKE2EM4NLGm2WFR8x9MbAtWxPPLdm0wUkuZv9trpwfSlL6tjdIa1+A==} ··· 4357 4374 resolution: {integrity: sha512-PvIHLUoWgSbDG7zLHqSqaCoZvHi6NNmfVFOqO+OnwvqMz/tqQr3FuGWS8ufluNddk7ZLBJYMrjcw1c6XzR12mA==} 4358 4375 peerDependencies: 4359 4376 vue: 3.5.18 4360 - 4361 - '@vue/shared@3.5.17': 4362 - resolution: {integrity: sha512-CabR+UN630VnsJO/jHWYBC1YVXyMq94KKp6iF5MQgZJs5I8cmjw6oVMO1oDbtBkENSHSSn/UadWlW/OAgdmKrg==} 4363 4377 4364 4378 '@vue/shared@3.5.18': 4365 4379 resolution: {integrity: sha512-cZy8Dq+uuIXbxCZpuLd2GJdeSO/lIzIspC2WtkqIpje5QyFbvLaI5wZtdUjLHjGZrlVX6GilejatWwVYYRc8tA==} ··· 8524 8538 resolution: {integrity: sha512-lPfAm42MxE4/456+QyIaaVBAwgpJb6xZ8PRu09utnhPdWwcyj9vgy6Sq0Z5yNbJ21EdxB5dRU/Qg8bsyAMtlcw==} 8525 8539 engines: {node: '>=12.20'} 8526 8540 8527 - type-fest@4.26.1: 8528 - resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==} 8529 - engines: {node: '>=16'} 8530 - 8531 8541 type-fest@4.41.0: 8532 8542 resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} 8533 8543 engines: {node: '>=16'} ··· 10607 10617 optionalDependencies: 10608 10618 '@types/node': 22.16.5 10609 10619 10610 - '@inquirer/confirm@5.1.13(@types/node@22.16.5)': 10611 - dependencies: 10612 - '@inquirer/core': 10.1.14(@types/node@22.16.5) 10613 - '@inquirer/type': 3.0.7(@types/node@22.16.5) 10614 - optionalDependencies: 10615 - '@types/node': 22.16.5 10616 - 10617 10620 '@inquirer/confirm@5.1.14(@types/node@22.16.5)': 10618 10621 dependencies: 10619 10622 '@inquirer/core': 10.1.15(@types/node@22.16.5) 10620 10623 '@inquirer/type': 3.0.8(@types/node@22.16.5) 10621 - optionalDependencies: 10622 - '@types/node': 22.16.5 10623 - 10624 - '@inquirer/core@10.1.14(@types/node@22.16.5)': 10625 - dependencies: 10626 - '@inquirer/figures': 1.0.12 10627 - '@inquirer/type': 3.0.8(@types/node@22.16.5) 10628 - ansi-escapes: 4.3.2 10629 - cli-width: 4.1.0 10630 - mute-stream: 2.0.0 10631 - signal-exit: 4.1.0 10632 - wrap-ansi: 6.2.0 10633 - yoctocolors-cjs: 2.1.2 10634 10624 optionalDependencies: 10635 10625 '@types/node': 22.16.5 10636 10626 ··· 10662 10652 yoctocolors-cjs: 2.1.2 10663 10653 optionalDependencies: 10664 10654 '@types/node': 22.16.5 10665 - 10666 - '@inquirer/figures@1.0.12': {} 10667 10655 10668 10656 '@inquirer/figures@1.0.13': {} 10669 10657 ··· 10728 10716 '@inquirer/type': 3.0.8(@types/node@22.16.5) 10729 10717 ansi-escapes: 4.3.2 10730 10718 yoctocolors-cjs: 2.1.2 10731 - optionalDependencies: 10732 - '@types/node': 22.16.5 10733 - 10734 - '@inquirer/type@3.0.7(@types/node@22.16.5)': 10735 10719 optionalDependencies: 10736 10720 '@types/node': 22.16.5 10737 10721 ··· 12025 12009 '@volar/language-core': 1.11.1 12026 12010 path-browserify: 1.0.1 12027 12011 12028 - '@vue/compiler-core@3.5.17': 12029 - dependencies: 12030 - '@babel/parser': 7.28.0 12031 - '@vue/shared': 3.5.17 12032 - entities: 4.5.0 12033 - estree-walker: 2.0.2 12034 - source-map-js: 1.2.1 12035 - 12036 12012 '@vue/compiler-core@3.5.18': 12037 12013 dependencies: 12038 12014 '@babel/parser': 7.28.0 ··· 12040 12016 entities: 4.5.0 12041 12017 estree-walker: 2.0.2 12042 12018 source-map-js: 1.2.1 12043 - 12044 - '@vue/compiler-dom@3.5.17': 12045 - dependencies: 12046 - '@vue/compiler-core': 3.5.17 12047 - '@vue/shared': 3.5.17 12048 12019 12049 12020 '@vue/compiler-dom@3.5.18': 12050 12021 dependencies: ··· 12097 12068 dependencies: 12098 12069 '@volar/language-core': 1.11.1 12099 12070 '@volar/source-map': 1.11.1 12100 - '@vue/compiler-dom': 3.5.17 12101 - '@vue/shared': 3.5.17 12071 + '@vue/compiler-dom': 3.5.18 12072 + '@vue/shared': 3.5.18 12102 12073 computeds: 0.0.1 12103 12074 minimatch: 9.0.5 12104 12075 muggle-string: 0.3.1 ··· 12110 12081 '@vue/language-core@3.0.1(typescript@5.8.3)': 12111 12082 dependencies: 12112 12083 '@volar/language-core': 2.4.17 12113 - '@vue/compiler-dom': 3.5.17 12084 + '@vue/compiler-dom': 3.5.18 12114 12085 '@vue/compiler-vue2': 2.7.16 12115 - '@vue/shared': 3.5.17 12086 + '@vue/shared': 3.5.18 12116 12087 alien-signals: 2.0.5 12117 12088 minimatch: 10.0.3 12118 12089 muggle-string: 0.4.1 ··· 12141 12112 '@vue/compiler-ssr': 3.5.18 12142 12113 '@vue/shared': 3.5.18 12143 12114 vue: 3.5.18(typescript@5.8.3) 12144 - 12145 - '@vue/shared@3.5.17': {} 12146 12115 12147 12116 '@vue/shared@3.5.18': {} 12148 12117 ··· 15339 15308 '@bundled-es-modules/cookie': 2.0.1 15340 15309 '@bundled-es-modules/statuses': 1.0.1 15341 15310 '@bundled-es-modules/tough-cookie': 0.1.6 15342 - '@inquirer/confirm': 5.1.13(@types/node@22.16.5) 15311 + '@inquirer/confirm': 5.1.14(@types/node@22.16.5) 15343 15312 '@mswjs/interceptors': 0.39.2 15344 15313 '@open-draft/deferred-promise': 2.2.0 15345 15314 '@open-draft/until': 2.1.0 ··· 15352 15321 path-to-regexp: 6.3.0 15353 15322 picocolors: 1.1.1 15354 15323 strict-event-emitter: 0.5.1 15355 - type-fest: 4.26.1 15324 + type-fest: 4.41.0 15356 15325 yargs: 17.7.2 15357 15326 optionalDependencies: 15358 15327 typescript: 5.8.3 ··· 16929 16898 16930 16899 type-fest@2.13.0: {} 16931 16900 16932 - type-fest@4.26.1: {} 16933 - 16934 16901 type-fest@4.41.0: {} 16935 16902 16936 16903 type-is@1.6.18: ··· 17159 17126 unplugin-vue-components@0.28.0(@babel/parser@7.28.0)(rollup@4.46.1)(vue@3.5.18(typescript@5.8.3)): 17160 17127 dependencies: 17161 17128 '@antfu/utils': 0.7.10 17162 - '@rollup/pluginutils': 5.1.4(rollup@4.46.1) 17129 + '@rollup/pluginutils': 5.2.0(rollup@4.46.1) 17163 17130 chokidar: 3.6.0 17164 17131 debug: 4.4.1 17165 17132 fast-glob: 3.3.3
+1
docs/guide/migration.md
··· 237 237 - `environmentMatchGlobs` config option. Use [`projects`](/guide/projects) instead. 238 238 - Reporter APIs `onCollected`, `onSpecsCollected`, `onPathsCollected`, `onTaskUpdate` and `onFinished`. See [`Reporters API`](/advanced/api/reporters) for new alternatives. These APIs were introduced in Vitest `v3.0.0`. 239 239 - `deps.external`, `deps.inline`, `deps.fallbackCJS` config options. Use `server.deps.external`, `server.deps.inline`, or `server.deps.fallbackCJS` instead. 240 + - `browser.testerScripts` config option. Use [`browser.testerHtmlPath`](/guide/browser/config#browser-testerhtmlpath) instead. 240 241 241 242 This release also removes all deprecated types. This finally fixes an issue where Vitest accidentally pulled in `@types/node` (see [#5481](https://github.com/vitest-dev/vitest/issues/5481) and [#6141](https://github.com/vitest-dev/vitest/issues/6141)). 242 243
+29
test/browser/custom-tester.html
··· 1 + <!DOCTYPE html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="UTF-8"> 5 + <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 + <title>Document</title> 7 + <script type="text/javascript"> 8 + globalThis.__injected = [] 9 + </script> 10 + <script> 11 + __injected.push(1) 12 + </script> 13 + <style> 14 + html { 15 + padding: 0; 16 + margin: 0; 17 + } 18 + body { 19 + padding: 0; 20 + margin: 0; 21 + min-height: 100vh; 22 + } 23 + </style> 24 + <script type="module" src="./injected.ts"></script> 25 + </head> 26 + <body> 27 + 28 + </body> 29 + </html>
+1 -1
test/browser/injected.ts
··· 1 1 // @ts-expect-error not typed global 2 - ;(__injected as string[]).push(3) 2 + ;(__injected as string[]).push(2)
-1
test/browser/package.json
··· 33 33 "@vitest/browser": "workspace:*", 34 34 "@vitest/bundled-lib": "link:./bundled-lib", 35 35 "@vitest/cjs-lib": "link:./cjs-lib", 36 - "@vitest/injected-lib": "link:./injected-lib", 37 36 "playwright": "^1.54.1", 38 37 "react": "^19.1.1", 39 38 "react-dom": "^19.1.1",
+2 -20
test/browser/vitest.config.mts
··· 62 62 : webdriverioInstances, 63 63 provider, 64 64 // isolate: false, 65 - testerScripts: [ 66 - { 67 - content: 'globalThis.__injected = []', 68 - type: 'text/javascript', 69 - }, 70 - { 71 - content: '__injected.push(1)', 72 - }, 73 - { 74 - id: 'ts.ts', 75 - content: '(__injected as string[]).push(2)', 76 - }, 77 - { 78 - src: './injected.ts', 79 - }, 80 - { 81 - src: '@vitest/injected-lib', 82 - }, 83 - ], 65 + testerHtmlPath: './custom-tester.html', 84 66 orchestratorScripts: [ 85 67 { 86 68 content: 'console.log("Hello, World");globalThis.__injected = []', ··· 90 72 content: 'import "./injected.ts"', 91 73 }, 92 74 { 93 - content: 'if(__injected[0] !== 3) throw new Error("injected not working")', 75 + content: 'if(__injected[0] !== 2) throw new Error("injected not working")', 94 76 }, 95 77 ], 96 78 commands: {
-13
docs/guide/browser/config.md
··· 295 295 } 296 296 ``` 297 297 298 - ## browser.testerScripts 299 - 300 - - **Type:** `BrowserScript[]` 301 - - **Default:** `[]` 302 - 303 - ::: danger DEPRECATED 304 - This API is deprecated an will be removed in Vitest 4. Please, use [`browser.testerHtmlPath`](#browser-testerhtmlpath) field instead. 305 - ::: 306 - 307 - Custom scripts that should be injected into the tester HTML before the tests environment is initiated. This is useful to inject polyfills required for Vitest browser implementation. It is recommended to use [`setupFiles`](#setupfiles) in almost all cases instead of this. 308 - 309 - The script `src` and `content` will be processed by Vite plugins. 310 - 311 298 ## browser.commands 312 299 313 300 - **Type:** `Record<string, BrowserCommand>`
-1
test/browser/injected-lib/index.js
··· 1 - __injected.push(4)
-7
test/browser/injected-lib/package.json
··· 1 - { 2 - "name": "@vitest/injected-lib", 3 - "type": "module", 4 - "exports": { 5 - "default": "./index.js" 6 - } 7 - }
-2
test/browser/test/injected.test.ts
··· 4 4 expect((globalThis as any).__injected).toEqual([ 5 5 1, 6 6 2, 7 - 3, 8 - 4, 9 7 ]) 10 8 })
+2 -2
test/cli/test/reported-tasks.test.ts
··· 1 1 import type { RunnerTestFile } from 'vitest' 2 - import type { WorkspaceProject } from 'vitest/node' 2 + import type { TestProject } from 'vitest/node' 3 3 import type { StateManager } from 'vitest/src/node/state.js' 4 4 import type { TestCase, TestCollection, TestModule } from '../../../packages/vitest/src/node/reporters/reported-tasks' 5 5 import { resolve } from 'pathe' ··· 9 9 const now = new Date() 10 10 const collectedTestModules: TestModule[] = [] 11 11 let state: StateManager 12 - let project: WorkspaceProject 12 + let project: TestProject 13 13 let files: RunnerTestFile[] 14 14 let testModule: TestModule 15 15
+2 -2
test/config/test/override.test.ts
··· 136 136 }, 137 137 watch: true, 138 138 }) 139 - expect(c.server.config.server.middlewareMode).toBe(true) 139 + expect(c.vite.config.server.middlewareMode).toBe(true) 140 140 expect(c.config.api).toEqual({ 141 141 middlewareMode: true, 142 142 token: expect.any(String), ··· 150 150 }, 151 151 watch: true, 152 152 }) 153 - expect(c.server.config.server.port).toBe(4321) 153 + expect(c.vite.config.server.port).toBe(4321) 154 154 expect(c.config.api).toEqual({ 155 155 port: 4321, 156 156 token: expect.any(String),
+3 -4
test/core/test/sequencers.test.ts
··· 1 - import type { Vitest, WorkspaceProject } from 'vitest/node' 2 - import type { WorkspaceSpec as DeprecatedWorkspaceSpec } from '../../../packages/vitest/src/node/pool' 1 + import type { TestProject, Vitest } from 'vitest/node' 3 2 import { describe, expect, test, vi } from 'vitest' 4 3 import { BaseSequencer } from '../../../packages/vitest/src/node/sequencers/BaseSequencer' 5 4 import { RandomSequencer } from '../../../packages/vitest/src/node/sequencers/RandomSequencer' ··· 24 23 config: { 25 24 root: import.meta.dirname, 26 25 }, 27 - } as any as WorkspaceProject 26 + } as any as TestProject 28 27 } 29 28 30 29 const workspace = buildWorkspace() 31 30 32 31 function workspaced(files: string[]) { 33 - return files.map(file => new TestSpecification(workspace, file, 'forks')) as DeprecatedWorkspaceSpec[] 32 + return files.map(file => new TestSpecification(workspace, file, 'forks')) 34 33 } 35 34 36 35 describe('base sequencer', () => {
+2 -3
test/reporters/src/context.ts
··· 21 21 getModuleById: () => undefined, 22 22 } 23 23 24 - const server: Partial<ViteDevServer> = { 24 + const vite: Partial<ViteDevServer> = { 25 25 moduleGraph: moduleGraph as ModuleGraph, 26 26 } 27 27 ··· 32 32 const context: Partial<Vitest> = { 33 33 state: state as StateManager, 34 34 config: config as ResolvedConfig, 35 - server: server as ViteDevServer, 36 - getProjectByTaskId: () => ({ getBrowserSourceMapModuleById: () => undefined }) as any, 35 + vite: vite as ViteDevServer, 37 36 getProjectByName: () => ({ getBrowserSourceMapModuleById: () => undefined }) as any, 38 37 snapshot: { 39 38 summary: { added: 100, _test: true },
-7
packages/browser/src/node/plugin.ts
··· 460 460 return 461 461 } 462 462 463 - if (!parentServer.testerScripts) { 464 - const testerScripts = await parentServer.formatScripts( 465 - parentServer.config.browser.testerScripts, 466 - ) 467 - parentServer.testerScripts = testerScripts 468 - } 469 463 const stateJs = typeof parentServer.stateJs === 'string' 470 464 ? parentServer.stateJs 471 465 : await parentServer.stateJs ··· 562 556 injectTo: 'head', 563 557 } as const 564 558 : null, 565 - ...parentServer.testerScripts, 566 559 ...testerTags, 567 560 ].filter(s => s != null) 568 561 },
-1
packages/browser/src/node/projectParent.ts
··· 23 23 24 24 export class ParentBrowserProject { 25 25 public orchestratorScripts: string | undefined 26 - public testerScripts: HtmlTagDescriptor[] | undefined 27 26 28 27 public faviconUrl: string 29 28 public prefixOrchestratorUrl: string
-1
packages/runner/src/utils/index.ts
··· 19 19 getTests, 20 20 hasFailed, 21 21 hasTests, 22 - isAtomTest, 23 22 isTestCase, 24 23 } from './tasks'
-7
packages/runner/src/utils/tasks.ts
··· 2 2 import type { Suite, Task, Test } from '../types/tasks' 3 3 import { toArray } from '@vitest/utils' 4 4 5 - /** 6 - * @deprecated use `isTestCase` instead 7 - */ 8 - export function isAtomTest(s: Task): s is Test { 9 - return isTestCase(s) 10 - } 11 - 12 5 export function isTestCase(s: Task): s is Test { 13 6 return s.type === 'test' 14 7 }
+1 -1
packages/vitest/src/api/setup.ts
··· 29 29 30 30 const clients = new Map<WebSocket, WebSocketRPC>() 31 31 32 - const server = _server || ctx.server 32 + const server = _server || ctx.vite 33 33 34 34 server.httpServer?.on('upgrade', (request: IncomingMessage, socket, head) => { 35 35 if (!request.url) {
+1 -1
packages/vitest/src/node/ast-collect.ts
··· 197 197 tasks: [], 198 198 start: 0, 199 199 end: 0, 200 - projectName: project.getName(), 200 + projectName: project.name, 201 201 meta: {}, 202 202 pool: project.browser ? 'browser' : project.config.pool, 203 203 file: null!,
+1 -79
packages/vitest/src/node/core.ts
··· 6 6 import type { SerializedCoverageConfig } from '../runtime/config' 7 7 import type { ArgumentsType, ProvidedContext, UserConsoleLog } from '../types/general' 8 8 import type { CliOptions } from './cli/cli-api' 9 - import type { ProcessPool, WorkspaceSpec } from './pool' 9 + import type { ProcessPool } from './pool' 10 10 import type { TestModule } from './reporters/reported-tasks' 11 11 import type { TestSpecification } from './spec' 12 12 import type { ResolvedConfig, TestProjectConfiguration, UserConfig, VitestRunMode } from './types/config' ··· 139 139 private _onUserTestsRerun: OnTestsRerunHandler[] = [] 140 140 private _onFilterWatchedSpecification: ((spec: TestSpecification) => boolean)[] = [] 141 141 142 - /** @deprecated will be removed in 4.0, use `onFilterWatchedSpecification` instead */ 143 - public get invalidates(): Set<string> { 144 - return this.watcher.invalidates 145 - } 146 - 147 - /** @deprecated will be removed in 4.0, use `onFilterWatchedSpecification` instead */ 148 - public get changedTests(): Set<string> { 149 - return this.watcher.changedTests 150 - } 151 - 152 142 /** 153 143 * The global config. 154 144 */ 155 145 get config(): ResolvedConfig { 156 146 assert(this._config, 'config') 157 147 return this._config 158 - } 159 - 160 - /** @deprecated use `vitest.vite` instead */ 161 - get server(): ViteDevServer { 162 - return this._vite! 163 148 } 164 149 165 150 /** ··· 193 178 get cache(): VitestCache { 194 179 assert(this._cache, 'cache') 195 180 return this._cache 196 - } 197 - 198 - /** @deprecated internal */ 199 - setServer(options: UserConfig, server: ViteDevServer): Promise<void> { 200 - return this._setServer(options, server) 201 181 } 202 182 203 183 /** @internal */ ··· 391 371 return this.coreWorkspaceProject 392 372 } 393 373 394 - /** @deprecated use `getRootProject` instead */ 395 - public getCoreWorkspaceProject(): TestProject { 396 - return this.getRootProject() 397 - } 398 - 399 374 /** 400 375 * Return project that has the root (or "global") config. 401 376 */ ··· 404 379 throw new Error(`Root project is not initialized. This means that the Vite server was not established yet and the the workspace config is not resolved.`) 405 380 } 406 381 return this.coreWorkspaceProject 407 - } 408 - 409 - /** 410 - * @deprecated use Reported Task API instead 411 - */ 412 - public getProjectByTaskId(taskId: string): TestProject { 413 - const task = this.state.idMap.get(taskId) 414 - const projectName = (task as File).projectName || task?.file?.projectName || '' 415 - return this.getProjectByName(projectName) 416 382 } 417 383 418 384 public getProjectByName(name: string): TestProject { ··· 570 536 return this.collectTests(files) 571 537 } 572 538 573 - /** @deprecated use `getRelevantTestSpecifications` instead */ 574 - public listFiles(filters?: string[]): Promise<TestSpecification[]> { 575 - return this.getRelevantTestSpecifications(filters) 576 - } 577 - 578 539 /** 579 540 * Returns the list of test files that match the config and filters. 580 541 * @param filters String filters to match the test files ··· 655 616 if (this.config.watch) { 656 617 await this.report('onWatcherStart') 657 618 } 658 - } 659 - 660 - /** 661 - * @deprecated remove when vscode extension supports "getModuleSpecifications" 662 - */ 663 - getProjectsByTestFile(file: string): WorkspaceSpec[] { 664 - return this.getModuleSpecifications(file) as WorkspaceSpec[] 665 - } 666 - 667 - /** @deprecated */ 668 - getFileWorkspaceSpecs(file: string): WorkspaceSpec[] { 669 - return this.getModuleSpecifications(file) as WorkspaceSpec[] 670 619 } 671 620 672 621 /** ··· 1135 1084 }) 1136 1085 } 1137 1086 1138 - /** @deprecated use `invalidateFile` */ 1139 - updateLastChanged(filepath: string): void { 1140 - this.invalidateFile(filepath) 1141 - } 1142 - 1143 1087 /** @internal */ 1144 1088 public _checkUnhandledErrors(errors: unknown[]): void { 1145 1089 if (errors.length && !this.config.dangerouslyIgnoreUnhandledErrors) { ··· 1262 1206 public async _globTestFilepaths() { 1263 1207 const specifications = await this.globTestSpecifications() 1264 1208 return Array.from(new Set(specifications.map(spec => spec.moduleId))) 1265 - } 1266 - 1267 - /** 1268 - * @deprecated use `globTestSpecifications` instead 1269 - */ 1270 - public async globTestSpecs(filters: string[] = []): Promise<TestSpecification[]> { 1271 - return this.globTestSpecifications(filters) 1272 - } 1273 - 1274 - /** 1275 - * @deprecated use `globTestSpecifications` instead 1276 - */ 1277 - public async globTestFiles(filters: string[] = []): Promise<TestSpecification[]> { 1278 - return this.globTestSpecifications(filters) 1279 - } 1280 - 1281 - /** @deprecated filter by `this.projects` yourself */ 1282 - public getModuleProjects(filepath: string): TestProject[] { 1283 - return this.projects.filter((project) => { 1284 - return project.getModulesByFilepath(filepath).size 1285 - // TODO: reevaluate || project.browser?.moduleGraph.getModulesByFile(id)?.size 1286 - }) 1287 1209 } 1288 1210 1289 1211 /**
+2 -2
packages/vitest/src/node/coverage.ts
··· 352 352 this.checkThresholds(resolvedThresholds) 353 353 354 354 if (this.options.thresholds?.autoUpdate && allTestsRun) { 355 - if (!this.ctx.server.config.configFile) { 355 + if (!this.ctx.vite.config.configFile) { 356 356 throw new Error( 357 357 'Missing configurationFile. The "coverage.thresholds.autoUpdate" can only be enabled when configuration file is used.', 358 358 ) 359 359 } 360 360 361 - const configFilePath = this.ctx.server.config.configFile 361 + const configFilePath = this.ctx.vite.config.configFile 362 362 const configModule = await this.parseConfigModule(configFilePath) 363 363 364 364 await this.updateThresholds({
+2 -2
packages/vitest/src/node/logger.ts
··· 207 207 208 208 if (this.ctx.config.ui) { 209 209 const host = this.ctx.config.api?.host || 'localhost' 210 - const port = this.ctx.server.config.server.port 210 + const port = this.ctx.vite.config.server.port 211 211 const base = this.ctx.config.uiBase 212 212 213 213 this.log(PAD + c.dim(c.green(`UI started at http://${host}:${c.bold(port)}${base}`))) 214 214 } 215 215 else if (this.ctx.config.api?.port) { 216 - const resolvedUrls = this.ctx.server.resolvedUrls 216 + const resolvedUrls = this.ctx.vite.resolvedUrls 217 217 // workaround for https://github.com/vitejs/vite/issues/15438, it was fixed in vite 5.1 218 218 const fallbackUrl = `http://${this.ctx.config.api.host || 'localhost'}:${this.ctx.config.api.port}` 219 219 const origin = resolvedUrls?.local[0] ?? resolvedUrls?.network[0] ?? fallbackUrl
+2 -20
packages/vitest/src/node/pool.ts
··· 12 12 import { createVmForksPool } from './pools/vmForks' 13 13 import { createVmThreadsPool } from './pools/vmThreads' 14 14 15 - /** 16 - * @deprecated use TestSpecification instead 17 - */ 18 - export type WorkspaceSpec = TestSpecification & [ 19 - /** 20 - * @deprecated use spec.project instead 21 - */ 22 - project: TestProject, 23 - /** 24 - * @deprecated use spec.moduleId instead 25 - */ 26 - file: string, 27 - /** 28 - * @deprecated use spec.pool instead 29 - */ 30 - options: { pool: Pool }, 31 - ] 32 - 33 15 export type RunWithFiles = ( 34 16 files: TestSpecification[], 35 17 invalidates?: string[] ··· 202 184 } 203 185 204 186 for (const spec of files) { 205 - const group = spec[0].config.sequence.groupOrder ?? 0 187 + const group = spec.project.config.sequence.groupOrder ?? 0 206 188 groups.add(group) 207 189 groupedSpecifications[group] ??= [] 208 190 groupedSpecifications[group].push(spec) ··· 242 224 } 243 225 244 226 specifications.forEach((specification) => { 245 - const pool = specification[2].pool 227 + const pool = specification.pool 246 228 filesByPool[pool] ??= [] 247 229 filesByPool[pool].push(specification) 248 230 })
+10 -5
packages/vitest/src/node/printError.ts
··· 141 141 = error instanceof TypeCheckError 142 142 ? error.stacks[0] 143 143 : stacks.find((stack) => { 144 + // we are checking that this module was processed by us at one point 144 145 try { 145 - const module = project._vite && project.getModuleById(stack.file) 146 - return ( 147 - (module?.transformResult || module?.ssrTransformResult) 148 - && existsSync(stack.file) 149 - ) 146 + const environments = [ 147 + ...Object.values(project._vite?.environments || {}), 148 + ...Object.values(project.browser?.vite.environments || {}), 149 + ] 150 + const hasResult = environments.some((environment) => { 151 + const modules = environment.moduleGraph.getModulesByFile(stack.file) 152 + return [...modules?.values() || []].some(module => !!module.transformResult) 153 + }) 154 + return hasResult && existsSync(stack.file) 150 155 } 151 156 catch { 152 157 return false
+4 -105
packages/vitest/src/node/project.ts
··· 1 1 import type { GlobOptions } from 'tinyglobby' 2 - import type { ModuleNode, TransformResult, ViteDevServer, InlineConfig as ViteInlineConfig } from 'vite' 2 + import type { ViteDevServer, InlineConfig as ViteInlineConfig } from 'vite' 3 3 import type { ModuleRunner } from 'vite/module-runner' 4 4 import type { Typechecker } from '../typecheck/typechecker' 5 5 import type { ProvidedContext } from '../types/general' 6 6 import type { OnTestsRerunHandler, Vitest } from './core' 7 7 import type { GlobalSetupFile } from './globalSetup' 8 - import type { Logger } from './logger' 9 - import type { WorkspaceSpec as DeprecatedWorkspaceSpec } from './pool' 10 - import type { Reporter } from './reporters' 11 8 import type { ParentProjectBrowser, ProjectBrowser } from './types/browser' 12 9 import type { 13 10 ProjectName, ··· 55 52 */ 56 53 public browser?: ProjectBrowser 57 54 58 - /** @deprecated use `vitest` instead */ 59 - public ctx: Vitest 60 - 61 55 /** 62 56 * Temporary directory for the project. This is unique for each project. Vitest stores transformed content here. 63 57 */ ··· 80 74 private _provided: ProvidedContext = {} as any 81 75 82 76 constructor( 83 - /** @deprecated */ 84 - public path: string | number, 85 77 vitest: Vitest, 86 78 public options?: InitializeProjectOptions | undefined, 87 79 ) { 88 80 this.vitest = vitest 89 - this.ctx = vitest 90 81 this.globalConfig = vitest.config 91 82 } 92 83 ··· 220 211 return this._serializeOverriddenConfig() 221 212 } 222 213 223 - /** @deprecated use `vite` instead */ 224 - public get server(): ViteDevServer { 225 - return this._vite! 226 - } 227 - 228 214 /** 229 215 * Check if this is the root project. The root project is the one that has the root config. 230 216 */ 231 217 public isRootProject(): boolean { 232 218 return this.vitest.getRootProject() === this 233 - } 234 - 235 - /** @deprecated use `isRootProject` instead */ 236 - public isCore(): boolean { 237 - return this.isRootProject() 238 - } 239 - 240 - /** @deprecated use `createSpecification` instead */ 241 - public createSpec(moduleId: string, pool: string): DeprecatedWorkspaceSpec { 242 - return new TestSpecification(this, moduleId, pool) as DeprecatedWorkspaceSpec 243 - } 244 - 245 - /** @deprecated */ 246 - initializeGlobalSetup(): Promise<void> { 247 - return this._initializeGlobalSetup() 248 219 } 249 220 250 221 /** @internal */ ··· 276 247 this.vitest.onTestsRerun(cb) 277 248 } 278 249 279 - /** @deprecated */ 280 - teardownGlobalSetup(): Promise<void> { 281 - return this._teardownGlobalSetup() 282 - } 283 - 284 250 /** @internal */ 285 251 async _teardownGlobalSetup(): Promise<void> { 286 252 if (!this._globalSetups) { ··· 289 255 for (const globalSetupFile of [...this._globalSetups].reverse()) { 290 256 await globalSetupFile.teardown?.() 291 257 } 292 - } 293 - 294 - /** @deprecated use `vitest.logger` instead */ 295 - get logger(): Logger { 296 - return this.vitest.logger 297 - } 298 - 299 - // it's possible that file path was imported with different queries (?raw, ?url, etc) 300 - /** @deprecated use `.vite` or `.browser.vite` directly */ 301 - getModulesByFilepath(file: string): Set<ModuleNode> { 302 - const set 303 - = this.server.moduleGraph.getModulesByFile(file) 304 - || this.browser?.vite.moduleGraph.getModulesByFile(file) 305 - return set || new Set() 306 - } 307 - 308 - /** @deprecated use `.vite` or `.browser.vite` directly */ 309 - getModuleById(id: string): ModuleNode | undefined { 310 - return ( 311 - this.server.moduleGraph.getModuleById(id) 312 - || this.browser?.vite.moduleGraph.getModuleById(id) 313 - ) 314 - } 315 - 316 - /** @deprecated use `.vite` or `.browser.vite` directly */ 317 - getSourceMapModuleById(id: string): TransformResult['map'] | undefined { 318 - const mod = this.server.moduleGraph.getModuleById(id) 319 - return mod?.ssrTransformResult?.map || mod?.transformResult?.map 320 - } 321 - 322 - /** @deprecated use `vitest.reporters` instead */ 323 - get reporters(): Reporter[] { 324 - return this.ctx.reporters 325 258 } 326 259 327 260 /** ··· 434 367 return !!this.typecheckFilesList && this.typecheckFilesList.includes(testPath) 435 368 } 436 369 437 - /** @deprecated use `serializedConfig` instead */ 438 - getSerializableConfig(): SerializedConfig { 439 - return this._serializeOverriddenConfig() 440 - } 441 - 442 370 /** @internal */ 443 371 async globFiles(include: string[], exclude: string[], cwd: string) { 444 372 const globOptions: GlobOptions = { ··· 481 409 } 482 410 } 483 411 return false 484 - } 485 - 486 - /** @deprecated use `matchesTestGlob` instead */ 487 - async isTargetFile(id: string, source?: string): Promise<boolean> { 488 - return this.matchesTestGlob(id, source ? () => source : undefined) 489 412 } 490 413 491 414 private isInSourceTestCode(code: string): boolean { ··· 602 525 return this.runner.import(moduleId) 603 526 } 604 527 605 - /** @deprecated use `name` instead */ 606 - public getName(): string { 607 - return this.config.name || '' 608 - } 609 - 610 - /** @deprecated internal */ 611 - public setServer(options: UserConfig, server: ViteDevServer): Promise<void> { 612 - return this._configureServer(options, server) 613 - } 614 - 615 528 private _setHash() { 616 529 this._hash = generateHash( 617 530 this._config!.root + this._config!.name, ··· 674 587 catch {} 675 588 } 676 589 677 - /** @deprecated */ 678 - public initBrowserProvider(): Promise<void> { 679 - return this._initBrowserProvider() 680 - } 681 - 682 590 /** @internal */ 683 591 _initBrowserProvider = deduped(async (): Promise<void> => { 684 592 if (!this.isBrowserEnabled() || this.browser?.provider) { ··· 705 613 /** @internal */ 706 614 static _createBasicProject(vitest: Vitest): TestProject { 707 615 const project = new TestProject( 708 - vitest.config.name || vitest.config.root, 709 616 vitest, 710 617 ) 711 618 project.runner = vitest.runner 712 - project._vite = vitest.server 619 + project._vite = vitest.vite 713 620 project._config = vitest.config 714 621 project._resolver = vitest._resolver 715 622 project._setHash() ··· 719 626 720 627 /** @internal */ 721 628 static _cloneBrowserProject(parent: TestProject, config: ResolvedConfig): TestProject { 722 - const clone = new TestProject( 723 - parent.path, 724 - parent.vitest, 725 - ) 629 + const clone = new TestProject(parent.vitest) 726 630 clone.runner = parent.runner 727 631 clone._vite = parent._vite 728 632 clone._resolver = parent._resolver ··· 746 650 }) as T 747 651 } 748 652 749 - export { 750 - /** @deprecated use `TestProject` instead */ 751 - TestProject as WorkspaceProject, 752 - } 753 - 754 653 export interface SerializedTestProject { 755 654 name: string 756 655 serializedConfig: SerializedConfig ··· 766 665 ctx: Vitest, 767 666 options: InitializeProjectOptions, 768 667 ): Promise<TestProject> { 769 - const project = new TestProject(workspacePath, ctx, options) 668 + const project = new TestProject(ctx, options) 770 669 771 670 const { configFile, ...restOptions } = options 772 671
-26
packages/vitest/src/node/spec.ts
··· 7 7 8 8 export class TestSpecification { 9 9 /** 10 - * @deprecated use `project` instead 11 - */ 12 - public readonly 0: TestProject 13 - /** 14 - * @deprecated use `moduleId` instead 15 - */ 16 - public readonly 1: string 17 - /** 18 - * @deprecated use `pool` instead 19 - */ 20 - public readonly 2: { pool: Pool } 21 - 22 - /** 23 10 * The task ID associated with the test module. 24 11 */ 25 12 public readonly taskId: string ··· 47 34 pool: Pool, 48 35 testLines?: number[] | undefined, 49 36 ) { 50 - this[0] = project 51 - this[1] = moduleId 52 - this[2] = { pool } 53 37 const name = project.config.name 54 38 const hashName = pool !== 'typescript' 55 39 ? name ··· 87 71 this.moduleId, 88 72 { pool: this.pool, testLines: this.testLines }, 89 73 ] 90 - } 91 - 92 - /** 93 - * for backwards compatibility 94 - * @deprecated 95 - */ 96 - * [Symbol.iterator](): Generator<string | TestProject, void, unknown> { 97 - yield this.project 98 - yield this.moduleId 99 - yield this.pool 100 74 } 101 75 }
+3 -3
packages/vitest/src/node/stdin.ts
··· 198 198 ) 199 199 200 200 const filter = await watchFilter.filter(async (str: string) => { 201 - const files = await ctx.globTestFiles([str]) 201 + const specifications = await ctx.globTestSpecifications([str]) 202 202 203 - return files 204 - .map(file => relative(ctx.config.root, file[1])) 203 + return specifications 204 + .map(specification => relative(ctx.config.root, specification.moduleId)) 205 205 .filter((file, index, all) => all.indexOf(file) === index) 206 206 }) 207 207
+1 -2
packages/vitest/src/public/node.ts
··· 21 21 export { VitestPlugin } from '../node/plugins' 22 22 export { resolveConfig } from '../node/plugins/publicConfig' 23 23 export { resolveFsAllow } from '../node/plugins/utils' 24 - export type { ProcessPool, WorkspaceSpec } from '../node/pool' 24 + export type { ProcessPool } from '../node/pool' 25 25 export { getFilePoolName } from '../node/pool' 26 26 export { createMethodsRPC } from '../node/pools/rpc' 27 27 export type { SerializedTestProject, TestProject } from '../node/project' 28 - export type { WorkspaceProject } from '../node/project' 29 28 export type { HTMLOptions } from '../node/reporters/html' 30 29 export type { JsonOptions } from '../node/reporters/json' 31 30
+3 -3
test/config/fixtures/bail/vitest.config.ts
··· 3 3 4 4 class TestNameSequencer { 5 5 async sort(files: TestSpecification[]): Promise<TestSpecification[]> { 6 - return [...files].sort(([, filenameA], [, filenameB]) => { 7 - if (filenameA > filenameB) 6 + return [...files].sort((a, b) => { 7 + if (a.moduleId > b.moduleId) 8 8 return 1 9 9 10 - if (filenameA < filenameB) 10 + if (a.moduleId < b.moduleId) 11 11 return -1 12 12 13 13 return 0
+1 -1
packages/browser/src/node/commands/fs.ts
··· 8 8 function assertFileAccess(path: string, project: TestProject) { 9 9 if ( 10 10 !isFileServingAllowed(path, project.vite) 11 - && !isFileServingAllowed(path, project.vitest.server) 11 + && !isFileServingAllowed(path, project.vitest.vite) 12 12 ) { 13 13 throw new Error( 14 14 `Access denied to "${path}". See Vite config documentation for "server.fs": https://vitejs.dev/config/server-options.html#server-fs-strict.`,
+3 -3
packages/ui/client/composables/explorer/utils.ts
··· 6 6 TestTreeNode, 7 7 UITaskTreeNode, 8 8 } from '~/composables/explorer/types' 9 - import { isAtomTest } from '@vitest/runner/utils' 9 + import { isTestCase } from '@vitest/runner/utils' 10 10 import { client } from '~/composables/client' 11 11 import { explorerTree } from '~/composables/explorer/index' 12 12 import { openedTreeItemsSet } from '~/composables/explorer/state' ··· 117 117 118 118 const task = client.state.idMap.get(id) 119 119 // if it is not a test just return 120 - if (!task || !isAtomTest(task)) { 120 + if (!task || !isTestCase(task)) { 121 121 return 122 122 } 123 123 ··· 148 148 taskNode.state = task.result?.state 149 149 } 150 150 else { 151 - if (isAtomTest(task)) { 151 + if (isTestCase(task)) { 152 152 taskNode = { 153 153 id: task.id, 154 154 fileId: task.file.id,
+1 -1
packages/vitest/src/node/cache/files.ts
··· 14 14 15 15 public async populateStats(root: string, specs: TestSpecification[]): Promise<void> { 16 16 const promises = specs.map((spec) => { 17 - const key = `${spec[0].name}:${relative(root, spec.moduleId)}` 17 + const key = `${spec.project.name}:${relative(root, spec.moduleId)}` 18 18 return this.updateStats(spec.moduleId, key) 19 19 }) 20 20 await Promise.all(promises)
-1
packages/vitest/src/node/cli/cli-config.ts
··· 415 415 description: 'Control if Vitest catches uncaught exceptions so they can be reported (default: `true`)', 416 416 }, 417 417 orchestratorScripts: null, 418 - testerScripts: null, 419 418 commands: null, 420 419 viewport: null, 421 420 screenshotDirectory: null,
+1 -1
packages/vitest/src/node/plugins/vitestResolver.ts
··· 11 11 if (id === 'vitest' || id.startsWith('@vitest/') || id.startsWith('vitest/')) { 12 12 // always redirect the request to the root vitest plugin since 13 13 // it will be the one used to run Vitest 14 - const resolved = await ctx.server.pluginContainer.resolveId(id, undefined, { 14 + const resolved = await ctx.vite.pluginContainer.resolveId(id, undefined, { 15 15 skip: new Set([plugin]), 16 16 ssr, 17 17 })
+1 -1
packages/vitest/src/node/pools/forks.ts
··· 175 175 return configs.get(project)! 176 176 } 177 177 178 - const _config = project.getSerializableConfig() 178 + const _config = project.serializedConfig 179 179 const config = wrapSerializableConfig(_config) 180 180 181 181 configs.set(project, config)
-5
packages/vitest/src/node/types/browser.ts
··· 207 207 screenshotFailures?: boolean 208 208 209 209 /** 210 - * Scripts injected into the tester iframe. 211 - * @deprecated Will be removed in the future, use `testerHtmlPath` instead. 212 - */ 213 - testerScripts?: BrowserScript[] 214 - /** 215 210 * Path to the index.html file that will be used to run tests. 216 211 */ 217 212 testerHtmlPath?: string
+3 -3
test/cli/fixtures/custom-pool/pool/custom-pool.ts
··· 13 13 async runTests(specs) { 14 14 vitest.logger.console.warn('[pool] printing:', options.print) 15 15 vitest.logger.console.warn('[pool] array option', options.array) 16 - for (const [project, file] of specs) { 16 + for (const { project, moduleId } of specs) { 17 17 vitest.state.clearFiles(project) 18 - vitest.logger.console.warn('[pool] running tests for', project.name, 'in', normalize(file).toLowerCase().replace(normalize(process.cwd()).toLowerCase(), '')) 18 + vitest.logger.console.warn('[pool] running tests for', project.name, 'in', normalize(moduleId).toLowerCase().replace(normalize(process.cwd()).toLowerCase(), '')) 19 19 const taskFile = createFileTask( 20 - file, 20 + moduleId, 21 21 project.config.root, 22 22 project.name, 23 23 'custom'