npm-test-helpers
Useful shared test helpers for writing apps that interact with npm.
Registry-Couch-App Integration Testing
It can be useful to test against a fully-functional Registry-Couch-App. npm-test-helpers provides a useful set of helpers for doing this.
setting up your local environment
- Edit your
local.ini
to have the settings outlined in https://github.com/npm/npm-registry-couchapp. - Create a
test-config.json
that has appropriate settings for your CouchDB configuration:
initializing a testing registry
Couch = Couch; couch;
tearing down the testing registry
var Couch = Couch; couch;
publishing a package
- make sure that you have an npm user available locally (npm-test-helpers simply executes npm).
- create a testing registry.
- for testing purposes, the following packages are available:
- request@1.9.0
- request@2.36.0
- tap@0.3.0
- thumbd@2.7.0
- thumbd@2.8.1
var Couch = Couch Registry = Registry; couch;
unpublish a package
var Couch = Couch Registry = Registry; couch;
delete a package
var Couch = Couch Registry = Registry; couch;
testing a follower feed
We use followers all over the place, for different pieces of npm's architecture, npm-test-helpers makes it easy to perform inegration tests on followers.
listening for a publication event
var Couch = Couch Registry = Registry; couch;