test(testing): add a test to ensure fakeAsync works with angular2/testing
This commit is contained in:
parent
ee298baa1b
commit
aaafdf03ce
|
@ -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'; }));
|
||||
|
|
Loading…
Reference in New Issue