-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
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
2.7.1 breaks vitest config #120
Comments
Is it related to this PR perhaps: #101 |
I have same issue. With vite config defineConfig({
plugins: [solid()],
test: {
environment: 'happy-dom',
globals: true,
includeSource: ['src/**/*.ts', 'src/**/*.tsx'],
deps: {
optimizer: {
web: {
include: ['src/**/*.ts', 'src/**/*.tsx'],
},
},
},
},
}); package.json {
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"test": "vitest"
},
"dependencies": {
"happy-dom": "^12.10.3",
"solid-js": "^1.8.5",
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vite-plugin-solid": "^2.7.2",
"vitest": "^0.34.6"
}
}
Steps
Result
Rollback to 2.7.0 fix problem |
FWIW, this issue also appears in 2.8.0 |
@ryansolid That seems plausible, but it's not clear what the work-around might be. So far I've been unable to get Vitest to load my test config at all when using vite-plugin-solid 2.7.1 or 2.8.0, which is blocking updates to Vite 5.x. Do you have any suggestions? Update: Confirmed, that PR is indeed the cause. Applying the following patch to 2.8.0 fixes the issue for me: diff --git a/dist/cjs/index.cjs b/dist/cjs/index.cjs
index a1fb81f39868f27809df7f87405edcf3259f1a0b..5cc5c29df3434235f8392e06a5697fdaea1d3d79 100644
--- a/dist/cjs/index.cjs
+++ b/dist/cjs/index.cjs
@@ -80,7 +80,8 @@ function solidPlugin(options = {}) {
},
...(isJestDomInstalled() ? {
setupFiles: [require$1.resolve('@testing-library/jest-dom/extend-expect.js')]
- } : {})
+ } : {}),
+ ...userConfig.test
}
} : {};
return {
diff --git a/dist/esm/index.mjs b/dist/esm/index.mjs
index 830a8ab7acdcbcba70510a1b9d166e0a01aeb885..406921f9091636e14da2d48d9220da52d727425f 100644
--- a/dist/esm/index.mjs
+++ b/dist/esm/index.mjs
@@ -77,7 +77,8 @@ function solidPlugin(options = {}) {
},
...(isJestDomInstalled() ? {
setupFiles: [require.resolve('@testing-library/jest-dom/extend-expect.js')]
- } : {})
+ } : {}),
+ ...userConfig.test
}
} : {};
return {
|
We've fixed some stuff around testing config in the latest. Can anyone confirm if this is still an issue? |
@ryansolid With 2.8.3 the unit tests are running to completion and they all pass, without the patch I was using for 2.8.0. However, I'm seeing dozens of instances of these two error messages in the logs:
This is the relevant bit of my config that previously had solved these error messages, but maybe there's a better way?
|
Here's a minimal example of the "multiple instances of SolidJS" error: https://stackblitz.com/edit/vitest-dev-vitest-xs9lkq?file=package.json |
I have a project that uses vitest with happy-dom in conjunction with vite-plugin-solid. Switching from 2.7.0 of vite-plugin-solid to 2.7.1 breaks my unit tests.
Here's a relevant part of the
test
section ofvite.config.mts
:When I run vitest with vite-plugin-solid 2.7.0, everything works fine. When I run it with 2.7.1, I get:
The fact that it's not honoring either the
environment: 'happy-dom'
setting or the setting that suppresses theregisterNodeLoader
warning makes me think that something about 2.7.1 is preventing the test config from being loaded at all.The text was updated successfully, but these errors were encountered: