Closed kayac-chang closed 11 months ago
- "@types/webextension-polyfill": "^0.10.5"
- "@webext-core/fake-browser": "^1.2.2"
- "typescript": "^5.2.2"
- "vite": "^4.4.9"
- "vitest": "^0.34.5"
- "@webext-core/storage": "^1.1.3",
- "webextension-polyfill": "^0.10.0"
In the future, make sure you add your lockfile to reproductions. Otherwise maintainers might use different versions of dependencies compared to your local setup.
I haven't updated the fake-browser package for a while, so it's likely something Vitest broke, but let me check it out.
Related to https://github.com/vitest-dev/vitest/issues/3936#issuecomment-1739836844.
diff --git a/vitest.config.ts b/vitest.config.ts
index 7f3ee78..6c7b4f1 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -7,5 +7,10 @@ export default defineConfig({
test: {
globals: true,
setupFiles: ["vitest.setup.ts"],
+ server: {
+ deps: {
+ inline: ["@webext-core/storage"],
+ },
+ },
},
});
It works now! Thank you @aklinker1.
Description
The mocking functionality no longer works. The following is the error we encountered in the vitest.
Dependencies
Steps To Reproduce
I follow the documentation with a minimal setup.
Also, provide the repository https://github.com/kayac-chang/webext-core-fake-browser-test