GithubHelp home page GithubHelp logo

Comments (9)

fatso83 avatar fatso83 commented on August 17, 2024 3

This is now published as 2.1.1.

from fake-timers.

benjamingr avatar benjamingr commented on August 17, 2024 1

Sorry @royalpinto , this is my bad - I meant to have it work but I made a silly mistake:

-            args: Array.prototype.slice.call(1)
+            args: Array.prototype.slice.call(arguments, 1)

Submitting a PR now.

from fake-timers.

fatso83 avatar fatso83 commented on August 17, 2024 1

@royalpinto No new patch release has been made. I'll see to it today.

from fake-timers.

fatso83 avatar fatso83 commented on August 17, 2024

Thanks for your bug report. This was quite unfortunate.

@elad-nach, any ideas?

from fake-timers.

acud avatar acud commented on August 17, 2024

@fatso83 I'm just looking into this as I'm trying to integrate 2.1.0 into sinon.

I'm also getting sporadic errors there - regardless to whether lolex is installed with shouldAdvanceTime = true. Errors are shown on mocha in the XHR test section on sinon.
I'm investigating in any case. will update once I nail it.

from fake-timers.

acud avatar acud commented on August 17, 2024

@fatso83 @benjamingr
could you also please have a second look at the nextTick() feature that was merged? The runJobs was added on that PR.
see here and here.

from fake-timers.

benjamingr avatar benjamingr commented on August 17, 2024

The error makes sense - the user overrode process.nextTick and did not uninstall the timer - Node was trying to flush the ticks and lolex was there.

I'll see if I can hack around it (by mimicing nextTick better), the obvious fix is to advance the clock synchronously and then uninstall.

A general way to reproduce would be:

lolex.install({}); // 
startSomeAsyncNodeAction((err, data) => {
 // startSomeAsyncNodeAction might call nextTick
});

from fake-timers.

benjamingr avatar benjamingr commented on August 17, 2024

It's because nextTick can take extra parameters, but we never documented it - I'll fix.

from fake-timers.

royalpinto avatar royalpinto commented on August 17, 2024

@fatso83 @elad-nach @benjamingr
Thank you all for the quick resolution 👍
Is this is available in the new npm release now ? I did a npm install lolex (it installed same 2.1.0) and error is still repeating.

from fake-timers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.