An example Couchbase Node.js example using couchnode.
- Based on NodeJS TDD Boilerplate.
- couchnode.
- mocha test framework.
- sinon stubbing framework.
- istanbul test coverage framework.
- jshint code linting.
- restify REST framework.
Note: Requires Couchbase 2.1.x or greater.
Assuming you already have NodeJS 0.10.13 (it will probably work with older versions as well) or higher installed:
git clone git@github.com:BryanDonovan/node-couchbase-example.git
cd node-couchbase-example
npm install .
make
The make
command will run JSHint, all the mocha unit tests, and check the test coverage. To view the test coverage report, open coverage/lcov-report/index.html after running make
.
You can also run make test
to just run the tests with coverage, make test-cov
to run the tests and attempt to open the coverage report in your browser, and make lint
to run JSHint.
To run the acceptance tests (which are just mocha tests), first start the server:
bin/start all
Then:
make test-acceptance
You can launch the sever on more than one port via bin/launch
, for example:
bin/launch users
.. will launch the users app on two ports (specified in config.js).
Then you can run the acceptance tests against either of those ports by specifying the PORT env variable:
PORT=12100 make test-acceptance