Skip to content
Pro
Block or report user

Report or block quasicomputational

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
Block or report user

Report or block quasicomputational

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse

Pinned

  1. Haskell

  2. 1
    Being able to flush promise resolution (or rejection) in tests is really, really handy, and [even essential sometimes](https://github.com/facebook/react/issues/14775). [Jest has an open issue for this](https://github.com/facebook/jest/issues/2157) but I'm impatient.
    2
    
                  
    3
    Setting this up in userland is possible but non-trivial - an adventure, even. I'll lay out what I had to do for any future intrepid types. I'll try to explain the reasoning for all of this and have nothing be magical.
    4
    
                  
    5
    The over-all target is to do task scheduling entirely in userland so that the task queue can be synchronously run to exhaustion. This entails faking timers and swapping out the native promise implementation for one that'll use the faked timers. All of this will be assuming you're using Jest, but the general ideas are test library agnostic.

Contribution activity

July 2019

Created a pull request in haskell/cabal that received 3 comments

Make `Setup.hs copy/install` work when data-files uses **.

Treating globs like filenames was always illegitimate, but this code was broken further by the addition of recursive globs. I had a look around for…

+44 −7 3 comments

Seeing something unexpected? Take a look at the GitHub profile guide.

You can’t perform that action at this time.