Last active
February 6, 2022 04:55
-
-
Save ardydedase/de9497235b79d088436df90f543d032e to your computer and use it in GitHub Desktop.
Setup spectator tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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