mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 02:54:21 +08:00
fix(@schematics/angular): uniformize guard spec with service spec
The current guard spec schematic uses `inject` whereas we dropped it for the service spec a while ago. This commits updates the guard spec schematic to be similar to the current service spec.
This commit is contained in:
parent
84e102bf3d
commit
f3259df1c6
@ -1,15 +1,16 @@
|
||||
import { TestBed, async, inject } from '@angular/core/testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { <%= classify(name) %>Guard } from './<%= dasherize(name) %>.guard';
|
||||
|
||||
describe('<%= classify(name) %>Guard', () => {
|
||||
let guard: <%= classify(name) %>Guard;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [<%= classify(name) %>Guard]
|
||||
});
|
||||
TestBed.configureTestingModule({});
|
||||
guard = TestBed.inject(<%= classify(name) %>Guard);
|
||||
});
|
||||
|
||||
it('should ...', inject([<%= classify(name) %>Guard], (guard: <%= classify(name) %>Guard) => {
|
||||
it('should be created', () => {
|
||||
expect(guard).toBeTruthy();
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user