X Tutup
Skip to content

Commit aaafdf0

Browse files
juliemrvsavkin
authored andcommitted
test(testing): add a test to ensure fakeAsync works with angular2/testing
1 parent ee298ba commit aaafdf0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/angular2/test/testing/testing_public_spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ddescribe,
77
xdescribe,
88
expect,
9+
fakeAsync,
910
tick,
1011
beforeEach,
1112
inject,
@@ -169,6 +170,14 @@ export function main() {
169170
(value) => { expect(value).toEqual('async value'); });
170171
}));
171172

173+
it('should allow the use of fakeAsync',
174+
inject([FancyService], fakeAsync((service) => {
175+
var value;
176+
service.getAsyncValue().then(function(val) { value = val; });
177+
tick();
178+
expect(value).toEqual('async value');
179+
})));
180+
172181
describe('using beforeEach', () => {
173182
beforeEach(inject([FancyService],
174183
(service) => { service.value = 'value modified in beforeEach'; }));

0 commit comments

Comments
 (0)
X Tutup