Skip to content

Instantly share code, notes, and snippets.

@whisher
Created December 27, 2018 18:11
import { TestBed, async, inject } from '@angular/core/testing';
import { StoreModule, Store, ActionReducerMap } from '@ngrx/store';
export const accountReducer: ActionReducerMap<{}> = {
status: {}
};
import { AccountGuard } from './account.guard';
describe('AccountGuard', () => {
let store: Store<{}>;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
StoreModule.forRoot({}),
StoreModule.forFeature('account', accountReducer)
],
providers: [Store, AccountGuard]
});
store = TestBed.get(Store);
});
it('should ...', inject([AccountGuard], (guard: AccountGuard) => {
expect(guard).toBeTruthy();
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment