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
conscious-sapphireOP•14mo ago
However if I remove the Provider then I get nullInjector error
wise-white•13mo ago
Maybe try
provideAngularQuery
instead?
However, both this and provideQueryClient(() => new QueryClient())
work for me, so it may be something completely different.jolly-crimson•13mo 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.json
conscious-sapphireOP•13mo ago
Yeah this was the solution! Thanks so much