sinonjs / fake-timers

Fake setTimeout and friends (collectively known as "timers"). Useful in your JavaScript tests. Extracted from Sinon.JS
BSD 3-Clause "New" or "Revised" License
802 stars 105 forks source link

Deno support #326

Closed benjamingr closed 4 years ago

benjamingr commented 4 years ago

So, fake-timers mostly works with Deno (just a bit weirdly):

The following seems to work and it's already possible to use fake-timers in Deno, just not in a very fun/useful way since we don't have exports in that entry point:

import 'https://unpkg.com/@sinonjs/fake-timers@6.0.1/fake-timers.js';

const clock = (window as any).FakeTimers.install();

setTimeout(() => {
    console.log('hello');
}, 29000);

clock.tick(30000);

This might get fixed by https://github.com/sinonjs/fake-timers/pull/320/files automagically

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.