SvelteStack / svelte-query

Performant and powerful remote data synchronization for Svelte
https://sveltequery.vercel.app
MIT License
814 stars 31 forks source link

Using svelte-query with jest - Cannot find module '../../src/methods/node.js' #47

Open annazus opened 3 years ago

annazus commented 3 years ago

When running a test file which imports from svelte-query I get

Cannot find module '../../src/methods/node.js' from 'node_modules/@sveltestack/svelte-query/dist/index.js'
Require stack:
node_modules/@sveltestack/svelte-query/dist/index.js
src/App.test.ts
at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:311:11)

Project to reproduce the issue here

The import in App.test.ts appears to be causing the problem.

I have placed svelte-query in devDependencies as suggested in another issue but still have the same problem.

annazus commented 2 years ago

Any updates on this? This prevents our running any tests in the project using svelte-query.

geoffreymugnier commented 2 years ago

Same problem here. Cannot test any component that's importing svelte-query. Any update ?