diff --git a/extensions/amp-access/0.1/test/test-amp-access-client.js b/extensions/amp-access/0.1/test/test-amp-access-client.js index 1e00805674d7..841b97236fbf 100644 --- a/extensions/amp-access/0.1/test/test-amp-access-client.js +++ b/extensions/amp-access/0.1/test/test-amp-access-client.js @@ -31,7 +31,7 @@ describes.realWin('AccessClientAdapter', { beforeEach(() => { ampdoc = env.ampdoc; - clock = lolex.install(); + clock = lolex.install({target: ampdoc.win}); validConfig = { 'authorization': 'https://acme.com/a?rid=READER_ID', @@ -190,8 +190,7 @@ describes.realWin('AccessClientAdapter', { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should time out XHR fetch', () => { + it('should time out XHR fetch', () => { contextMock.expects('buildUrl') .withExactArgs( 'https://acme.com/a?rid=READER_ID', diff --git a/extensions/amp-access/0.1/test/test-amp-access-server-jwt.js b/extensions/amp-access/0.1/test/test-amp-access-server-jwt.js index 4ffa43813fff..fcc295d2d6a5 100644 --- a/extensions/amp-access/0.1/test/test-amp-access-server-jwt.js +++ b/extensions/amp-access/0.1/test/test-amp-access-server-jwt.js @@ -34,7 +34,7 @@ describes.realWin('AccessServerJwtAdapter', {amp: true}, env => { beforeEach(() => { win = env.win; ampdoc = env.ampdoc; - clock = lolex.install(); + clock = lolex.install({target: win}); validConfig = { 'authorization': 'https://acme.com/a?rid=READER_ID', @@ -277,8 +277,7 @@ describes.realWin('AccessServerJwtAdapter', {amp: true}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should fail when authorize-and-fill times out', () => { + it('should fail when authorize-and-fill times out', () => { adapter.serviceUrl_ = 'http://localhost:8000/af'; const authdata = {}; const jwt = {'amp_authdata': authdata}; @@ -408,8 +407,7 @@ describes.realWin('AccessServerJwtAdapter', {amp: true}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should fail when JWT fetch times out', () => { + it('should fail when JWT fetch times out', () => { contextMock.expects('buildUrl') .withExactArgs( 'https://acme.com/a?rid=READER_ID', diff --git a/extensions/amp-access/0.1/test/test-amp-access-server.js b/extensions/amp-access/0.1/test/test-amp-access-server.js index 0fff6bcf70e0..cf9b9f5b3607 100644 --- a/extensions/amp-access/0.1/test/test-amp-access-server.js +++ b/extensions/amp-access/0.1/test/test-amp-access-server.js @@ -33,7 +33,7 @@ describes.realWin('AccessServerAdapter', {amp: true}, env => { win = env.win; document = win.document; ampdoc = env.ampdoc; - clock = lolex.install(); + clock = lolex.install({target: win}); validConfig = { 'authorization': 'https://acme.com/a?rid=READER_ID', @@ -232,8 +232,7 @@ describes.realWin('AccessServerAdapter', {amp: true}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should time out XHR fetch', () => { + it('should time out XHR fetch', () => { adapter.serviceUrl_ = 'http://localhost:8000/af'; contextMock.expects('collectUrlVars') .withExactArgs( diff --git a/extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js b/extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js index 496654b83c50..3e9d79637810 100644 --- a/extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js +++ b/extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js @@ -291,9 +291,8 @@ describes.realWin('amp-ad-3p-impl', { expect(ad3p.renderOutsideViewport()).to.equal(1.25); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should only allow rendering one ad per second', function* () { - const clock = lolex.install(); + it('should only allow rendering one ad per second', function* () { + const clock = lolex.install({target: win}); const ad3p2 = createAmpAd(win); expect(ad3p.renderOutsideViewport()).to.equal(3); expect(ad3p2.renderOutsideViewport()).to.equal(3); diff --git a/extensions/amp-ad/0.1/test/test-concurrent-load.js b/extensions/amp-ad/0.1/test/test-concurrent-load.js index 2f35eacd476c..394e1743e87f 100644 --- a/extensions/amp-ad/0.1/test/test-concurrent-load.js +++ b/extensions/amp-ad/0.1/test/test-concurrent-load.js @@ -65,15 +65,15 @@ describes.realWin('concurrent-load', {}, env => { } }); - // TODO(lannka, #12486): Make this test work with lolex v2. - describe.skip('incrementLoadingAds', () => { + describe('incrementLoadingAds', () => { let win; let clock; beforeEach(() => { win = env.win; - clock = lolex.install({toFake: ['Date', 'setTimeout', 'clearTimeout']}); + clock = lolex.install({ + target: win, toFake: ['Date', 'setTimeout', 'clearTimeout']}); installTimerService(win); }); diff --git a/extensions/amp-analytics/0.1/test/test-events.js b/extensions/amp-analytics/0.1/test/test-events.js index 596aa05cb309..adaf481aec8a 100644 --- a/extensions/amp-analytics/0.1/test/test-events.js +++ b/extensions/amp-analytics/0.1/test/test-events.js @@ -542,7 +542,7 @@ describes.realWin('Events', {amp: 1}, env => { let tracker; beforeEach(() => { - clock = lolex.install(root.ampdoc.win); + clock = lolex.install({target: root.ampdoc.win}); tracker = root.getTracker('timer', TimerEventTracker); }); @@ -685,8 +685,7 @@ describes.realWin('Events', {amp: 1}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('timers started and stopped by the same event on the same target' + it('timers started and stopped by the same event on the same target' + ' do not have race condition problems', () => { const fn1 = sandbox.stub(); tracker.add(analyticsElement, 'timer', {timerSpec: { @@ -740,8 +739,7 @@ describes.realWin('Events', {amp: 1}, env => { expect(fn2.args[0][0].type).to.equal('timer'); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('fires on the appropriate interval', () => { + it('fires on the appropriate interval', () => { const fn1 = sandbox.stub(); tracker.add(analyticsElement, 'timer', {timerSpec: { interval: 10, @@ -791,8 +789,7 @@ describes.realWin('Events', {amp: 1}, env => { expect(fn1.args[0][0].type).to.equal('timer'); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('stops firing after the maxTimerLength is exceeded', () => { + it('stops firing after the maxTimerLength is exceeded', () => { const fn1 = sandbox.stub(); tracker.add(analyticsElement, 'timer', {timerSpec: { interval: 10, @@ -861,8 +858,7 @@ describes.realWin('Events', {amp: 1}, env => { expect(tracker.getTrackedTimerKeys()).to.have.length(1); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should unlisten tracker', () => { + it('should unlisten tracker', () => { const fn1 = sandbox.stub(); const u1 = tracker.add(analyticsElement, 'timer', {timerSpec: { interval: 10, @@ -889,8 +885,7 @@ describes.realWin('Events', {amp: 1}, env => { expect(countIntervals()).to.equal(0); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should dispose all trackers', () => { + it('should dispose all trackers', () => { const fn1 = sandbox.stub(); tracker.add(analyticsElement, 'timer', {timerSpec: { interval: 10, @@ -911,8 +906,7 @@ describes.realWin('Events', {amp: 1}, env => { expect(countIntervals()).to.equal(0); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should create events with timer vars', () => { + it('should create events with timer vars', () => { const handler = sandbox.stub(); tracker.add(analyticsElement, 'timer', {timerSpec: { interval: 3, diff --git a/extensions/amp-analytics/0.1/test/test-requests.js b/extensions/amp-analytics/0.1/test/test-requests.js index 442f80e9efc3..c1a42a7bc827 100644 --- a/extensions/amp-analytics/0.1/test/test-requests.js +++ b/extensions/amp-analytics/0.1/test/test-requests.js @@ -29,7 +29,7 @@ describes.realWin('Requests', {amp: 1}, env => { beforeEach(() => { installVariableService(env.win); ampdoc = env.ampdoc; - clock = lolex.install(); + clock = lolex.install({target: ampdoc.win}); preconnectSpy = sandbox.spy(); preconnect = { url: preconnectSpy, @@ -40,8 +40,7 @@ describes.realWin('Requests', {amp: 1}, env => { clock.uninstall(); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - describe.skip('RequestHandler', () => { + describe('RequestHandler', () => { describe('batch Delay', () => { it('maxDelay should be a number', () => { const r1 = {'baseUrl': 'r1', 'maxDelay': 1}; diff --git a/test/functional/test-ad-cid.js b/test/functional/test-ad-cid.js index 2c4fe13d6275..f71f7a1c9a0a 100644 --- a/test/functional/test-ad-cid.js +++ b/test/functional/test-ad-cid.js @@ -36,7 +36,8 @@ describes.realWin('ad-cid', {amp: true}, env => { beforeEach(() => { win = env.win; sandbox = env.sandbox; - clock = lolex.install({toFake: ['Date', 'setTimeout', 'clearTimeout']}); + clock = lolex.install({ + target: win, toFake: ['Date', 'setTimeout', 'clearTimeout']}); element = env.win.document.createElement('amp-ad'); element.setAttribute('type', '_ping_'); const ampdoc = env.ampdoc; @@ -89,8 +90,7 @@ describes.realWin('ad-cid', {amp: true}, env => { }); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should return on timeout', () => { + it('should return on timeout', () => { config.clientIdScope = cidScope; sandbox.stub(cidService, 'get').callsFake(() => { return Services.timerFor(win).promise(2000); diff --git a/test/functional/test-cid.js b/test/functional/test-cid.js index f1a6f015db04..269cc4381e2d 100644 --- a/test/functional/test-cid.js +++ b/test/functional/test-cid.js @@ -723,7 +723,8 @@ describes.realWin('cid', {amp: true}, env => { win = env.win; ampdoc = env.ampdoc; sandbox = env.sandbox; - clock = lolex.install({toFake: ['Date', 'setTimeout', 'clearTimeout']}); + clock = lolex.install({ + target: win, toFake: ['Date', 'setTimeout', 'clearTimeout']}); cid = cidServiceForDocForTesting(ampdoc); }); @@ -758,8 +759,7 @@ describes.realWin('cid', {amp: true}, env => { .to.eventually.equal('cid-from-viewer'); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('get method should time out when in Viewer', function *() { + it('get method should time out when in Viewer', function *() { win.parent = {}; stubServiceForDoc(sandbox, ampdoc, 'viewer', 'sendMessageAwaitResponse') .returns(new Promise(() => {})); @@ -795,8 +795,7 @@ describes.realWin('cid', {amp: true}, env => { setCookie(win, '_ga', '', 0); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should use cid api on pub origin if opted in', () => { + it('should use cid api on pub origin if opted in', () => { const getScopedCidStub = sandbox.stub(cid.cidApi_, 'getScopedCid'); getScopedCidStub.returns(Promise.resolve('cid-from-api')); return cid.get({ @@ -811,8 +810,7 @@ describes.realWin('cid', {amp: true}, env => { }); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should fallback to cookie if cid api returns nothing', () => { + it('should fallback to cookie if cid api returns nothing', () => { sandbox.stub(cid.cidApi_, 'getScopedCid').returns(Promise.resolve()); return cid.get({ scope: 'AMP_ECID_GOOGLE', diff --git a/test/functional/test-custom-element.js b/test/functional/test-custom-element.js index 3cd85c153e49..a790144ec959 100644 --- a/test/functional/test-custom-element.js +++ b/test/functional/test-custom-element.js @@ -106,7 +106,7 @@ describes.realWin('CustomElement', {amp: true}, env => { win = env.win; doc = win.document; ampdoc = env.ampdoc; - clock = lolex.install(); + clock = lolex.install({target: win}); resources = Services.resourcesForDoc(doc); resources.isBuildOn_ = true; resourcesMock = sandbox.mock(resources); @@ -362,8 +362,7 @@ describes.realWin('CustomElement', {amp: true}, env => { expect(element.isBuilt()).to.equal(false); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('Element - re-upgrade to new direct instance', () => { + it('Element - re-upgrade to new direct instance', () => { const element = new ElementClass(); expect(element.isUpgraded()).to.equal(false); const newImpl = new TestElement(element); @@ -375,8 +374,7 @@ describes.realWin('CustomElement', {amp: true}, env => { expect(element.upgradeDelayMs_).to.equal(0); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('Element - re-upgrade to new promised instance', () => { + it('Element - re-upgrade to new promised instance', () => { const element = new ElementClass(); expect(element.isUpgraded()).to.equal(false); const oldImpl = element.implementation_; @@ -544,8 +542,7 @@ describes.realWin('CustomElement', {amp: true}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('Element - buildCallback cannot be called twice', () => { + it('Element - buildCallback cannot be called twice', () => { const element = new ElementClass(); expect(element.isBuilt()).to.equal(false); expect(testElementBuildCallback).to.have.not.been.called; @@ -717,8 +714,7 @@ describes.realWin('CustomElement', {amp: true}, env => { expect(testElementLayoutCallback).to.have.not.been.called; }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('Element - layoutCallback', () => { + it('Element - layoutCallback', () => { const element = new ElementClass(); element.setAttribute('layout', 'fill'); container.appendChild(element); @@ -839,8 +835,7 @@ describes.realWin('CustomElement', {amp: true}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should dequeue all actions after build', () => { + it('should dequeue all actions after build', () => { const element = new ElementClass(); const handler = sandbox.spy(); element.implementation_.executeAction = handler; @@ -1513,7 +1508,7 @@ describes.realWin('CustomElement', {amp: true}, env => { beforeEach(() => { win = env.win; doc = win.document; - clock = lolex.install(); + clock = lolex.install({target: win}); ElementClass = doc.registerElement('amp-test-loader', { prototype: createAmpElementProtoForTesting( win, 'amp-test-loader', TestElement), @@ -1715,8 +1710,7 @@ describes.realWin('CustomElement', {amp: true}, env => { expect(toggle).to.have.not.been.called; }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should turn on when enters viewport', () => { + it('should turn on when enters viewport', () => { stubInA4A(false); const toggle = sandbox.spy(element, 'toggleLoading_'); element.viewportCallback(true); diff --git a/test/functional/test-jank-meter.js b/test/functional/test-jank-meter.js index e4adfb889948..bf943b01f63d 100644 --- a/test/functional/test-jank-meter.js +++ b/test/functional/test-jank-meter.js @@ -26,7 +26,8 @@ describes.realWin('jank-meter', {}, env => { beforeEach(() => { win = env.win; - clock = lolex.install({toFake: ['Date', 'setTimeout', 'clearTimeout']}); + clock = lolex.install({ + target: win, toFake: ['Date', 'setTimeout', 'clearTimeout']}); meter = new JankMeter(win); meter.perf_ = { @@ -40,8 +41,7 @@ describes.realWin('jank-meter', {}, env => { clock.uninstall(); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should use first schedule time when scheduled ' + + it('should use first schedule time when scheduled ' + 'multiple times ', () => { meter.onScheduled(); clock.tick(5); @@ -52,8 +52,7 @@ describes.realWin('jank-meter', {}, env => { expect(meter.badFrameCnt_).to.equal(1); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should count bad frames correctly', () => { + it('should count bad frames correctly', () => { runTask(16); expect(meter.totalFrameCnt_).to.equal(1); expect(meter.badFrameCnt_).to.equal(0); diff --git a/test/functional/test-layout-delay-meter.js b/test/functional/test-layout-delay-meter.js index 8b6f70042936..01531990fc6a 100644 --- a/test/functional/test-layout-delay-meter.js +++ b/test/functional/test-layout-delay-meter.js @@ -37,7 +37,8 @@ describes.realWin('layout-delay-meter', { installPerformanceService(win); const perf = Services.performanceFor(win); sandbox.stub(perf, 'isPerformanceTrackingOn').callsFake(() => true); - clock = lolex.install({toFake: ['Date', 'setTimeout', 'clearTimeout']}); + clock = lolex.install({ + target: win, toFake: ['Date', 'setTimeout', 'clearTimeout']}); tickSpy = sandbox.spy(perf, 'tickDelta'); meter = new LayoutDelayMeter(win, 2); @@ -47,8 +48,7 @@ describes.realWin('layout-delay-meter', { clock.uninstall(); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should tick when there is a delay', () => { + it('should tick when there is a delay', () => { clock.tick(100); meter.enterViewport(); // first time in viewport clock.tick(100); diff --git a/test/functional/test-performance.js b/test/functional/test-performance.js index 76d719f73dfc..78e9295cee48 100644 --- a/test/functional/test-performance.js +++ b/test/functional/test-performance.js @@ -32,7 +32,8 @@ describes.realWin('performance', {amp: true}, env => { win = env.win; sandbox = env.sandbox; ampdoc = env.ampdoc; - clock = lolex.install({toFake: ['Date', 'setTimeout', 'clearTimeout']}); + clock = lolex.install({ + target: win, toFake: ['Date', 'setTimeout', 'clearTimeout']}); installPerformanceService(env.win); perf = Services.performanceFor(env.win); }); @@ -105,8 +106,7 @@ describes.realWin('performance', {amp: true}, env => { expect(perf.events_.length).to.equal(50); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should add default optional relative start time on the ' + + it('should add default optional relative start time on the ' + 'queued tick event', () => { clock.tick(150); perf.tick('start0'); @@ -117,8 +117,7 @@ describes.realWin('performance', {amp: true}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should drop events in the head of the queue', () => { + it('should drop events in the head of the queue', () => { const tickTime = 100; clock.tick(tickTime); @@ -197,8 +196,7 @@ describes.realWin('performance', {amp: true}, env => { describe('channel established', () => { - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should flush events when channel is ready', () => { + it('should flush events when channel is ready', () => { sandbox.stub(viewer, 'getParam').withArgs('csi').returns(null); sandbox.stub(viewer, 'whenMessagingReady') .returns(Promise.resolve()); @@ -297,8 +295,7 @@ describes.realWin('performance', {amp: true}, env => { expect(tickDeltaStub.firstCall.args[1]).to.equal(0); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should calculate after visible', () => { + it('should calculate after visible', () => { perf.coreServicesAvailable(); firstVisibleTime = 5; @@ -309,8 +306,7 @@ describes.realWin('performance', {amp: true}, env => { expect(tickDeltaStub.firstCall.args[1]).to.equal(5); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should be zero after visible but for earlier event', () => { + it('should be zero after visible but for earlier event', () => { perf.coreServicesAvailable(); firstVisibleTime = 5; @@ -374,8 +370,7 @@ describes.realWin('performance', {amp: true}, env => { .returns(Promise.resolve()); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should forward all queued tick events', () => { + it('should forward all queued tick events', () => { perf.tick('start0'); clock.tick(1); perf.tick('start1'); @@ -412,8 +407,7 @@ describes.realWin('performance', {amp: true}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should forward tick events', () => { + it('should forward tick events', () => { return perf.coreServicesAvailable().then(() => { clock.tick(100); perf.tick('start0'); @@ -538,8 +532,7 @@ describes.realWin('performance', {amp: true}, env => { return perf.coreServicesAvailable(); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should call prerenderComplete on viewer', () => { + it('should call prerenderComplete on viewer', () => { clock.tick(100); whenFirstVisibleResolve(); sandbox.stub(viewer, 'getParam').withArgs('csi').returns('1'); @@ -557,8 +550,7 @@ describes.realWin('performance', {amp: true}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should call prerenderComplete on viewer even if csi is ' + + it('should call prerenderComplete on viewer even if csi is ' + 'off', () => { clock.tick(100); whenFirstVisibleResolve(); @@ -573,8 +565,7 @@ describes.realWin('performance', {amp: true}, env => { }); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should tick `pc` with delta=400 when user request document ' + + it('should tick `pc` with delta=400 when user request document ' + 'to be visible before before first viewport completion', () => { clock.tick(100); whenFirstVisibleResolve(); @@ -620,8 +611,7 @@ describes.realWin('performance', {amp: true}, env => { perf.coreServicesAvailable(); }); - // TODO(dvoytenko, #12486): Make this test work with lolex v2. - it.skip('should call prerenderComplete on viewer', () => { + it('should call prerenderComplete on viewer', () => { sandbox.stub(viewer, 'getParam').withArgs('csi').returns('1'); sandbox.stub(viewer, 'isEmbedded').returns(true); clock.tick(300); diff --git a/test/functional/test-position-observer.js b/test/functional/test-position-observer.js index dad485d11468..17646c764b26 100644 --- a/test/functional/test-position-observer.js +++ b/test/functional/test-position-observer.js @@ -40,7 +40,7 @@ describes.realWin('PositionObserver', {amp: 1}, env => { let elem1; let clock; beforeEach(() => { - clock = lolex.install(); + clock = lolex.install({target: ampdoc.win}); posOb = new PositionObserver(ampdoc); sandbox.stub(posOb.vsync_, 'measure').callsFake(callback => { win.setTimeout(callback, 1); @@ -88,8 +88,7 @@ describes.realWin('PositionObserver', {amp: 1}, env => { }); }); - // TODO(zhouyx, #12486): Make this test work with lolex v2. - describe.skip('update position info at correct time', () => { + describe('update position info at correct time', () => { let top; beforeEach(() => { top = 0; @@ -134,8 +133,7 @@ describes.realWin('PositionObserver', {amp: 1}, env => { }); }); - // TODO(zhouyx, #12486): Make this test work with lolex v2. - describe.skip('should provide correct position data', () => { + describe('should provide correct position data', () => { let top; beforeEach(() => { top = 0; diff --git a/test/functional/test-yield.js b/test/functional/test-yield.js index f4851edc6e3f..b46c794a273b 100644 --- a/test/functional/test-yield.js +++ b/test/functional/test-yield.js @@ -24,15 +24,15 @@ describes.realWin('yield', {}, env => { beforeEach(() => { win = env.win; - clock = lolex.install({toFake: ['Date', 'setTimeout', 'clearTimeout']}); + clock = lolex.install( + {target: win, toFake: ['Date', 'setTimeout', 'clearTimeout']}); }); afterEach(() => { clock.uninstall(); }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should work with nested promises', function* () { + it('should work with nested promises', function* () { let value = false; const nestPromise = level => { @@ -51,8 +51,7 @@ describes.realWin('yield', {}, env => { expect(value).to.be.true; }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should work with promise chain', function* () { + it('should work with promise chain', function* () { let value; const chainPromise = Promise.resolve(); @@ -67,8 +66,7 @@ describes.realWin('yield', {}, env => { expect(value).to.be.true; }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should work with promise inside setTimeout', function* () { + it('should work with promise inside setTimeout', function* () { let value; win.setTimeout(() => { value = false; @@ -84,8 +82,7 @@ describes.realWin('yield', {}, env => { expect(value).to.be.true; }); - // TODO(lannka, #12486): Make this test work with lolex v2. - it.skip('should work with manually resolved promise inside ' + + it('should work with manually resolved promise inside ' + 'setTimeout', function* () { let value; let resolver;