Skip to content

Instantly share code, notes, and snippets.

@ardydedase
Last active February 6, 2022 04:55
Show Gist options
  • Save ardydedase/de9497235b79d088436df90f543d032e to your computer and use it in GitHub Desktop.
Save ardydedase/de9497235b79d088436df90f543d032e to your computer and use it in GitHub Desktop.
Setup spectator tests
import { AppComponent } from './app.component';
import { Spectator, createComponentFactory } from '@ngneat/spectator';
import { GithubService } from './github.service';
describe('AppComponentSpectator', () => {
let spectator: Spectator<AppComponent>;
const createComponent = createComponentFactory({
component: AppComponent,
providers: [
{ provide: GithubService, useValue: {} }
],
});
beforeEach(() => spectator = createComponent());
it('should create', () => {
expect(spectator.component).toBeTruthy();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment