Why is jest.useFakeTimers not working with RxJs Observable delay
问题 I'm wondering why jest.useFakeTimers is working with setTimeout but not with the delay operator of RxJs: jest.useFakeTimers(); import {Observable} from 'rxjs/Observable'; import 'rxjs'; describe('timers', () => { it('should resolve setTimeout synchronously', () => { const spy = jest.fn(); setTimeout(spy, 20); expect(spy).not.toHaveBeenCalled(); jest.runTimersToTime(20); expect(spy).toHaveBeenCalledTimes(1); }); it('should resolve setInterval synchronously', () => { const spy = jest.fn();