Skip to content

Commit 721b553

Browse files
cexbrayatdgp1130
authored andcommitted
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. (cherry picked from commit f3259df)
1 parent 0626af1 commit 721b553

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { TestBed, async, inject } from '@angular/core/testing';
1+
import { TestBed } from '@angular/core/testing';
22

33
import { <%= classify(name) %>Guard } from './<%= dasherize(name) %>.guard';
44

55
describe('<%= classify(name) %>Guard', () => {
6+
let guard: <%= classify(name) %>Guard;
7+
68
beforeEach(() => {
7-
TestBed.configureTestingModule({
8-
providers: [<%= classify(name) %>Guard]
9-
});
9+
TestBed.configureTestingModule({});
10+
guard = TestBed.inject(<%= classify(name) %>Guard);
1011
});
1112

12-
it('should ...', inject([<%= classify(name) %>Guard], (guard: <%= classify(name) %>Guard) => {
13+
it('should be created', () => {
1314
expect(guard).toBeTruthy();
14-
}));
15+
});
1516
});

0 commit comments

Comments
 (0)