You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[INFO 10:22:03 AM] [v1.10.2] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 10:22:03 AM] [API] Running Vitest v3.0.2 (smartvui/vitest.workspace.ts) with "node /home/pdan/.vscode-insiders/extensions/vitest.explorer-1.10.2/dist/worker.js"
[INFO 10:22:03 AM] [Worker] �[?25l
[INFO 10:22:05 AM] [API] Watching /home/pdan/Work/PDan/smartvui/vitest.workspace.ts
[INFO 10:22:05 AM] [VSCODE] Watching smartvui with pattern **/*
[INFO 10:22:16 AM] [API] Collecting tests: lib/src/composables/usePlatform/usePlatform.test.ts [@pdanpdan/smartvui]
[10:22:16 AM] Not starting the runner because tests are being collected for lib/src/composables/usePlatform/usePlatform.test.ts
[10:22:17 AM] There is no test run for"usePlatform.test.ts [@pdanpdan/smartvui]"
[10:22:17 AM] No test run to finish for lib/src/composables/usePlatform/usePlatform.test.ts
[10:22:17 AM] [VSCODE] Ignoring file: node_modules/.vite/results.json
[10:22:26 AM] [VSCODE] Ignoring file: node_modules/.vue-global-types/vue_3.3_false.d.ts
[10:22:26 AM] [VSCODE] Ignoring file: lib/node_modules/.vue-global-types/vue_3.5_false.d.ts
[10:22:26 AM] [VSCODE] Ignoring file: node_modules/.vue-global-types/vue_3.3_false.d.ts
[10:22:31 AM] Initiating deferred test run
[INFO 10:22:31 AM] Running 1 file(s) with name pattern: ^\s?usePlatform \[browser\] should keep SSR values on mount$
[10:22:31 AM] The runner is starting because tests lib/src/composables/usePlatform/usePlatform.test.ts were started due to a file change
[10:22:31 AM] Enqueuing "should keep SSR values on mount"
[10:22:31 AM] No task result for"usePlatform.test.ts [@pdanpdan/smartvui]", ignoring
[10:22:31 AM] No task result for"usePlatform [browser]", ignoring
[10:22:31 AM] Enqueuing "should keep SSR values on mount" because it was just collected
[10:22:31 AM] Ignore "should add listener on mount" during collection
[10:22:31 AM] Ignore "should use browser values after mount" during collection
[10:22:31 AM] Ignore "should change values when mediaQuery changes" during collection
[10:22:31 AM] Ignore "should change values based on userAgent" during collection
[10:22:31 AM] Ignore "should remove listener on unmount" during collection
[10:22:31 AM] Ignore "should not warn if installed" during collection
[10:22:31 AM] Ignore "should warn if not installed" during collection
[10:22:31 AM] No errors found for"usePlatform.test.ts [@pdanpdan/smartvui]"
[10:22:31 AM] No errors found for"usePlatform [browser]"
[10:22:31 AM] Marking "should keep SSR values on mount" as failed with 1 errors
[10:22:31 AM] Ending test run lib/src/composables/usePlatform/usePlatform.test.ts
[10:22:31 AM] [VSCODE] Ignoring file: node_modules/.vite/results.json
[10:23:45 AM] [VSCODE] Ignoring file: .git/FETCH_HEAD
[10:23:46 AM] [VSCODE] Ignoring file: lib/src/composables/usePlatform/usePlatform.test.ts.git
[10:23:46 AM] [VSCODE] Ignoring file: .git/FETCH_HEAD
[10:23:47 AM] [VSCODE] Ignoring file: lib/src/composables/usePlatform/usePlatform.test.ts.git
[INFO 10:23:50 AM] [API] Collecting tests: lib/src/composables/usePlatform/usePlatform.node.test.ts [@pdanpdan/smartvui]
[10:23:50 AM] Not starting the runner because tests are being collected for lib/src/composables/usePlatform/usePlatform.node.test.ts
[10:23:50 AM] There is no test run for"usePlatform.node.test.ts [@pdanpdan/smartvui]"
[10:23:50 AM] No test run to finish for lib/src/composables/usePlatform/usePlatform.node.test.ts
[10:23:51 AM] [VSCODE] Ignoring file: node_modules/.vite/results.json
[INFO 10:24:14 AM] [API] Collecting tests: lib/src/utils/utils.test.ts [@pdanpdan/smartvui]
[10:24:14 AM] Not starting the runner because tests are being collected for lib/src/utils/utils.test.ts
[10:24:14 AM] There is no test run for"utils.test.ts [@pdanpdan/smartvui]"
[10:24:14 AM] No test run to finish for lib/src/utils/utils.test.ts
[10:24:14 AM] [VSCODE] Ignoring file: node_modules/.vite/results.json
[INFO 10:26:38 AM] [API] Collecting tests: lib/src/composables/useColorTheme/useColorTheme.node.test.ts [@pdanpdan/smartvui]
[10:26:38 AM] Not starting the runner because tests are being collected for lib/src/composables/useColorTheme/useColorTheme.node.test.ts
[10:26:39 AM] There is no test run for"useColorTheme.node.test.ts [@pdanpdan/smartvui]"
[10:26:39 AM] No test run to finish for lib/src/composables/useColorTheme/useColorTheme.node.test.ts
[10:26:39 AM] [VSCODE] Ignoring file: node_modules/.vite/results.json
[10:26:47 AM] [VSCODE] Ignoring file: .git/FETCH_HEAD
[10:26:48 AM] [VSCODE] Ignoring file: lib/src/composables/usePlatform/usePlatform.test.ts.git
[10:26:48 AM] [VSCODE] Ignoring file: lib/src/composables/usePlatform/usePlatform.node.test.ts.git
[10:26:48 AM] [VSCODE] Ignoring file: lib/src/utils/utils.test.ts.git
[10:26:48 AM] [VSCODE] Ignoring file: lib/vite.esm.config.ts.git
[10:26:48 AM] [VSCODE] Ignoring file: lib/src/composables/useColorTheme/useColorTheme.node.test.ts.git
[10:26:48 AM] [VSCODE] Ignoring file: .git/FETCH_HEAD
[10:26:49 AM] [VSCODE] Ignoring file: lib/src/composables/usePlatform/usePlatform.test.ts.git
[10:26:49 AM] [VSCODE] Ignoring file: lib/src/composables/usePlatform/usePlatform.node.test.ts.git
[10:26:49 AM] [VSCODE] Ignoring file: lib/src/utils/utils.test.ts.git
[10:26:49 AM] [VSCODE] Ignoring file: lib/vite.esm.config.ts.git
[10:26:49 AM] [VSCODE] Ignoring file: lib/src/composables/useColorTheme/useColorTheme.node.test.ts.git
[INFO 10:27:30 AM] [API] Collecting tests: lib/src/composables/useScreen/useScreen.node.test.ts [@pdanpdan/smartvui]
[10:27:30 AM] Not starting the runner because tests are being collected for lib/src/composables/useScreen/useScreen.node.test.ts
[10:27:31 AM] There is no test run for"useScreen.node.test.ts [@pdanpdan/smartvui]"
[10:27:31 AM] No test run to finish for lib/src/composables/useScreen/useScreen.node.test.ts
[10:27:31 AM] [VSCODE] Ignoring file: node_modules/.vite/results.json
[INFO 10:27:35 AM] [API] Collecting tests: lib/src/composables/useScreen/useScreen.test.ts [@pdanpdan/smartvui]
[10:27:35 AM] Not starting the runner because tests are being collected for lib/src/composables/useScreen/useScreen.test.ts
[10:27:36 AM] There is no test run for"useScreen.test.ts [@pdanpdan/smartvui]"
[10:27:36 AM] No test run to finish for lib/src/composables/useScreen/useScreen.test.ts
[10:27:36 AM] [VSCODE] Ignoring file: node_modules/.vite/results.json
[INFO 10:28:13 AM] [API] Collecting tests: lib/src/composables/usePrefersDark/usePrefersDark.node.test.ts [@pdanpdan/smartvui]
[10:28:13 AM] Not starting the runner because tests are being collected for lib/src/composables/usePrefersDark/usePrefersDark.node.test.ts
[10:28:13 AM] There is no test run for"usePrefersDark.node.test.ts [@pdanpdan/smartvui]"
[10:28:13 AM] No test run to finish for lib/src/composables/usePrefersDark/usePrefersDark.node.test.ts
[10:28:13 AM] [VSCODE] Ignoring file: node_modules/.vite/results.json
[INFO 10:28:16 AM] [API] Collecting tests: lib/src/composables/useRender/useRender.node.test.ts [@pdanpdan/smartvui]
[10:28:16 AM] Not starting the runner because tests are being collected for lib/src/composables/useRender/useRender.node.test.ts
[10:28:17 AM] There is no test run for"useRender.node.test.ts [@pdanpdan/smartvui]"
[10:28:17 AM] No test run to finish for lib/src/composables/useRender/useRender.node.test.ts
[10:28:17 AM] [VSCODE] Ignoring file: node_modules/.vite/results.json
[INFO 10:28:19 AM] [API] Collecting tests: lib/src/composables/useRender/useRender.test.ts [@pdanpdan/smartvui]
[10:28:19 AM] Not starting the runner because tests are being collected for lib/src/composables/useRender/useRender.test.ts
[Error 10:28:20 AM] Error in /home/pdan/Work/PDan/smartvui/lib/src/composables/useRender/useRender.test.ts ReferenceError: document is not defined
at /home/pdan/Work/PDan/smartvui/lib/src/composables/useRender/useRender.test.ts:12:36
at file:///home/pdan/Work/PDan/smartvui/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:547:43
at runWithSuite (file:///home/pdan/Work/PDan/smartvui/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:31:9)
at Object.collect (file:///home/pdan/Work/PDan/smartvui/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:547:13)
at Object.collect (file:///home/pdan/Work/PDan/smartvui/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:551:57)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at collectTests (file:///home/pdan/Work/PDan/smartvui/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:910:28)
at startTests (file:///home/pdan/Work/PDan/smartvui/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1363:17)
at file:///home/pdan/Work/PDan/smartvui/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_lightningcss@1._trnudnvldpj6bpfboutyykjhte/node_modules/vitest/dist/chunks/runBaseTests.Ba8jtu6O.js:129:11
at withEnv (file:///home/pdan/Work/PDan/smartvui/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_lightningcss@1._trnudnvldpj6bpfboutyykjhte/node_modules/vitest/dist/chunks/runBaseTests.Ba8jtu6O.js:92:5)
[10:28:20 AM] There is no test run for"useRender.test.ts [@pdanpdan/smartvui]"
[10:28:20 AM] No test run to finish for lib/src/composables/useRender/useRender.test.ts
Extension Version
1.10.2
Vitest Version
3.0.2
Validations
Check that you are using the latest version of the extension
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
pdanpdan
changed the title
Vitest VSCode v1.10.2 does not respect environment settings for tests
Vitest VSCode v1.10.2 does not respect environment set in vite config
Jan 21, 2025
Describe the bug
Vitest plugin tries to execute with node (default) environment for non 'src/**/*.node.test.ts' test files.
If the environment is specified in the test file with
// @vitest-environment happy-dom
then all works as expected.Vitest CLI runs as expected.
Reproduction
The project uses
pnpm
on node v20, linux, latest VSCode insiders,vitest
3.0.2.Repo: https://github.com/pdanpdan/smartvui
/vitest.workspace.ts
/lib/vite.esm.config.ts
Output
Extension Version
1.10.2
Vitest Version
3.0.2
Validations
The text was updated successfully, but these errors were encountered: