test(testing): add a test to ensure fakeAsync works with angular2/testing

This commit is contained in:
Julie Ralph 2015-12-14 18:51:37 -08:00 committed by vsavkin
parent ee298baa1b
commit aaafdf03ce
1 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import {
ddescribe,
xdescribe,
expect,
fakeAsync,
tick,
beforeEach,
inject,
@ -169,6 +170,14 @@ export function main() {
(value) => { expect(value).toEqual('async value'); });
}));
it('should allow the use of fakeAsync',
inject([FancyService], fakeAsync((service) => {
var value;
service.getAsyncValue().then(function(val) { value = val; });
tick();
expect(value).toEqual('async value');
})));
describe('using beforeEach', () => {
beforeEach(inject([FancyService],
(service) => { service.value = 'value modified in beforeEach'; }));