Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests and small syntactic improvements #2

Open
wants to merge 8 commits into
base: latest
Choose a base branch
from

Conversation

alexewerlof
Copy link

@alexewerlof alexewerlof commented May 3, 2019

Edit: The commits are atomic and can be clicked to verify the changes in each step.

  • Added package-lock.json to comply with modern NPM
  • Removed the reference to bluebird since native Promises are available in Node versions that are officially supported
  • Added some jest tests
  • Updated the readme to declare that we now have tests

No functionality has changed, except removing reference to the undocumented feature of using bluebird (which wasn't even on package.json).

@@ -13,6 +13,7 @@ function _inflight (unique, doFly) {
return resolve(doFly())
}))
active[unique].then(cleanup, cleanup)
function cleanup() { delete active[unique] }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other copy of cleanup() should also be removed, but really I'd prefer that you just remove this commit and 1eb2b41

@@ -1,21 +1,14 @@
'use strict'
module.exports = inflight

let Bluebird
Copy link
Owner

@iarna iarna Aug 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this? Why not let people use bluebird if they have bluebird? Bluebird is more than a ponyfill, it also adds additional really handy APIs. Also it's often faster than native Promises.

@@ -25,10 +25,10 @@ req('foo').then(…)
req('foo').then(…)
```

## SEE ALSO
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the tests, but as a rule I use tap for my tests, not jest. Ordinarily I'm not that picky, but as I'll have to maintain this going forward, I would like to see them in tap format before landing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants