Skip to content

Instantly share code, notes, and snippets.

@jfirebaugh
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfirebaugh/9145774 to your computer and use it in GitHub Desktop.
Save jfirebaugh/9145774 to your computer and use it in GitHub Desktop.
Feature: NPM notifies me when my dependencies are out of date
In order to avoid accidentally running the tests against out of
date dependencies, npm should notify me when I try to do so.
Scenario:
Given I have a package.json that declares a dependency on foo@1.0
And I have run `npm install` and installed foo@1.0
And my coworker updates package.json to depend on foo@1.1
When I pull that change and run `npm test`
Then I should get an error
And my test script should not run
{
...
"scripts": {
"pretest": "npm ls --depth=Infinity > /dev/null",
"test": "mocha or whatever"
}
}
@jfirebaugh
Copy link
Author

Thanks to @Mr0grog for the suggestion: https://gist.github.com/Mr0grog/9145413

@Mr0grog
Copy link

Mr0grog commented Feb 26, 2014

Oh, cool, I didn’t even know "pretest" was a thing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment