Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jkyoutsey/c78e0c51f83a75a997d631e58e41d7d6 to your computer and use it in GitHub Desktop.
Save jkyoutsey/c78e0c51f83a75a997d631e58e41d7d6 to your computer and use it in GitHub Desktop.
Angular CanDeactivate Guard Unit Test Configuration
describe('CanDeactivateGuardService', () => {
let mockComponent: MockComponent;
let service: CanDeactivateGuardService;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
CanDeactivateGuardService,
MockComponent
]
});
service = TestBed.get(CanDeactivateGuardService);
mockComponent = TestBed.get(MockComponent);
});
it('expect service to instantiate', () => {
expect(service).toBeTruthy();
});
// more tests
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment