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,
|
ddescribe,
|
||||||
xdescribe,
|
xdescribe,
|
||||||
expect,
|
expect,
|
||||||
|
fakeAsync,
|
||||||
tick,
|
tick,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
inject,
|
inject,
|
||||||
|
@ -169,6 +170,14 @@ export function main() {
|
||||||
(value) => { expect(value).toEqual('async value'); });
|
(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', () => {
|
describe('using beforeEach', () => {
|
||||||
beforeEach(inject([FancyService],
|
beforeEach(inject([FancyService],
|
||||||
(service) => { service.value = 'value modified in beforeEach'; }));
|
(service) => { service.value = 'value modified in beforeEach'; }));
|
||||||
|
|
Loading…
Reference in New Issue