Provide angular query in spec file
When I provideQueryClient(() => new QueryClient()) in a spec file for jest testa
I get random errors that say cannot read properties of undefined reading
4 Replies
fair-roseOP•17mo ago
However if I remove the Provider then I get nullInjector error
ratty-blush•16mo ago
Maybe try
provideAngularQuery instead?
However, both this and provideQueryClient(() => new QueryClient()) work for me, so it may be something completely different.protestant-coral•16mo ago
I don't know what the random errors are exactly without more information. But recently I got TypeScript errors on queries in Jest unit tests in a NX monorepo which were resolved by removing
preserveSymlinks: true from tsconfig.spec.jsonfair-roseOP•16mo ago
Yeah this was the solution! Thanks so much