Skip to content

Instantly share code, notes, and snippets.

@cakeinpanic
Created November 14, 2017 18:48
Show Gist options
  • Save cakeinpanic/cc9c939705d2df98c6f36aadc99baf03 to your computer and use it in GitHub Desktop.
Save cakeinpanic/cc9c939705d2df98c6f36aadc99baf03 to your computer and use it in GitHub Desktop.
// https://github.com/angular/angular/issues/10127#issuecomment-247873713
it('should run async test with successful delayed Observable', fakeAsync(() => {
let actuallyDone = false;
let currentTime = 0;
spyOn(Scheduler.async, 'now').and.callFake(() => currentTime);
let source = Observable.of(true).delay(10);
source.subscribe(() => {
actuallyDone = true;
});
currentTime = 10;
tick(10);
expect(actuallyDone).toEqual(true);
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment