We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[x] Support request
Getting an error Cannot read property 'getComponentFromError' of null when writing basic tests for injectables (HTTP or otherwise).
Cannot read property 'getComponentFromError' of null
No error should be displayed and the tests should pass.
import { SpectatorService, createServiceFactory } from '@ngneat/spectator'; import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class UserService { constructor() {} } describe('Service: UserService', () => { let spectator: SpectatorService<UserService>; const createService = createServiceFactory(UserService); // Error is thrown here. TypeError: Cannot read property 'getComponentFromError' of null beforeEach(() => (spectator = createService())); it('exists', () => { expect(spectator.service).toBeDefined(); }); });
Angular version: 8.2.11 (latest) Spectator version: 4.4.2 For Tooling issues: - Node version: 12.6.0 - Platform: macOS 10.15 Others: This is happening in an Nx 8.6 monorepo.
The text was updated successfully, but these errors were encountered:
It seems not to be related to Spectator (it works here).
I think it has something to do with your test setup or with Nx workspaces. Are you using Jest? Maybe check this issue.
Sorry, something went wrong.
Yes, we are using Jest :-) Thank you for pointing me in the right direction!
No branches or pull requests
I'm submitting a...
[x] Support request
Current behavior
Getting an error
Cannot read property 'getComponentFromError' of null
when writing basic tests for injectables (HTTP or otherwise).Expected behavior
No error should be displayed and the tests should pass.
Minimal reproduction of the problem with instructions
Environment
The text was updated successfully, but these errors were encountered: