-
Notifications
You must be signed in to change notification settings - Fork 117
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
Vitest v0.34.x incompatibilities and @testing-library/jest-dom v6 fixes for: "Error: Cannot find module ...@testing-library/jest-dom/extend-expect.js" #133
Comments
There was a breaking change in version 6.0 that removed the |
ah, thanks 🙏 i took a quick run at updating the template but ultimately hit weirdness when trying to update
...and new (old) warnings are shown:
Test error details (click to expand)
here's the working patch i'm running atm: diff --git a/js-vitest/package.json b/js-vitest/package.json
index 579774e..b268ca7 100644
--- a/js-vitest/package.json
+++ b/js-vitest/package.json
@@ -12,15 +12,15 @@
},
"license": "MIT",
"devDependencies": {
- "@solidjs/testing-library": "^0.7.1",
- "@testing-library/jest-dom": "^5.16.5",
- "jsdom": "^22.1.0",
+ "@solidjs/testing-library": "^0.8.4",
+ "@testing-library/jest-dom": "^6.1.4",
+ "jsdom": "^23.0.0",
"solid-devtools": "^0.27.3",
"vite": "^4.3.9",
"vite-plugin-solid": "^2.7.0",
- "vitest": "^0.32.2"
+ "vitest": "^0.33.0"
},
"dependencies": {
- "solid-js": "^1.7.6"
+ "solid-js": "^1.8.5"
}
}
diff --git a/js-vitest/vite.config.js b/js-vitest/vite.config.js
index 034b1ba..91654b2 100644
--- a/js-vitest/vite.config.js
+++ b/js-vitest/vite.config.js
@@ -9,9 +9,7 @@ export default defineConfig({
transformMode: {
web: [/\.jsx?$/],
},
- setupFiles: ['node_modules/@testing-library/jest-dom/extend-expect.js'],
- // otherwise, solid would be loaded twice:
- deps: { registerNodeLoader: true },
+ setupFiles: './vitest-setup.js',
// if you have few tests, try commenting one
// or both out to improve performance:
// threads: false,
diff --git a/js-vitest/vitest-setup.js b/js-vitest/vitest-setup.js
new file mode 100644
index 0000000..8339619
--- /dev/null
+++ b/js-vitest/vitest-setup.js
@@ -0,0 +1,7 @@
+import '@testing-library/jest-dom/vitest';
+import { cleanup } from '@solidjs/testing-library';
+import { afterEach } from 'vitest';
+
+
+afterEach(() => cleanup());
+ fwiw, i also tried the fixes suggested by i'll poke around a bit over in https://github.com/vitest-dev/vitest to see if i can spot the problematic change 👍 |
hi again 👋
on macOS
v14.1 (23B74)
with[email protected]
and[email protected]
using thevite.config.js
file shown here, i'm seeing an error when i runvitest
:i believe i have the module in question installed:
looking at the files in the package, i see:
note that
extend-expect.js
is not there. seems the@testing-library/jest-dom
package moved some files around since the template was last updated.The text was updated successfully, but these errors were encountered: