We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defineConfig
Although defineConfig has been implemented by #749, it doesn't seem to work properly because of runtime limitations.
import { defineConfig } from 'vitest' would throw an error as follows:
import { defineConfig } from 'vitest'
throw new Error("Vitest was initialized with native Node instead of Vite Node"); ^ Error: Vitest was initialized with native Node instead of Vite Node
Perhaps we could change the API to
- import { defineConfig } from 'vitest' + import { defineConfig } from 'vitest/node'
and leave vitest as the entry point for testing runtime purposes.
vitest
Set vitest.config.mjs as this doc describes
vitest.config.mjs
System: OS: macOS 12.2.1 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 238.73 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.0 - ~/.nn/current/bin/node Yarn: 1.22.17 - ~/.nn/current/bin/yarn npm: 8.1.0 - ~/.nn/current/bin/npm Browsers: Chrome: 98.0.4758.102 Firefox: 90.0.2 Safari: 15.3 npmPackages: @vitejs/plugin-legacy: ^1.6.4 => 1.7.1 @vitejs/plugin-react: ^1.2.0 => 1.2.0 vitest: ^0.3.5 => 0.3.5
pnpm
The text was updated successfully, but these errors were encountered:
vitest/node looks good to me. PR welcome!
vitest/node
Sorry, something went wrong.
fix: move config related methods to 'vitest/node'
fd9b8fd
closes vitest-dev#764
feat(watchAtMost): new function (vitest-dev#764)
7c4fefc
Co-authored-by: webfansplz <> Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Successfully merging a pull request may close this issue.
Describe the bug
Although
defineConfig
has been implemented by #749, it doesn't seem to work properly because of runtime limitations.import { defineConfig } from 'vitest'
would throw an error as follows:Perhaps we could change the API to
and leave
vitest
as the entry point for testing runtime purposes.Reproduction
Set
vitest.config.mjs
as this doc describesSystem Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: