Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[tests] use Makefile so that we can add benchmarking also

  • Loading branch information...
commit f48c1bfe310bbe5de80a38bde5e53bc1612a6c0e 1 parent 4c35424
Edward Hotchkiss edwardhotchkiss authored

Showing 3 changed files with 21 additions and 6 deletions. Show diff stats Hide diff stats

  1. +7 0 Makefile
  2. +1 1  package.json
  3. +13 5 test/index.test.js
7 Makefile
... ... @@ -0,0 +1,7 @@
  1 +
  2 +SHELL := /bin/bash
  3 +
  4 +test:
  5 + @vows test/index.test.js --spec
  6 +
  7 +.PHONY: test
2  package.json
@@ -28,6 +28,6 @@
28 28 "url":"http://github.com/edwardhotchkiss/short/LICENSE"
29 29 }],
30 30 "scripts":{
31   - "test":"vows test/*.test.js --spec"
  31 + "test":"make test"
32 32 }
33 33 }
18 test/index.test.js
... ... @@ -1,6 +1,6 @@
1 1
2 2 /*!
3   - Core Modules
  3 + requires
4 4 */
5 5
6 6 var vows = require('vows'),
@@ -9,15 +9,23 @@ var vows = require('vows'),
9 9 short = require('../lib/short');
10 10
11 11 /*!
12   - Connect to MongoDB
  12 + connect to mongodb
13 13 */
14 14
15   -var MONGO_DB_SHORT = process.env.MONGO_DB_SHORT || 'mongodb://localhost/short';
  15 +var MONGO_DB = process.env.MONGO_DB || 'mongodb://localhost/short';
16 16
17   -short.connect(MONGO_DB_SHORT);
  17 +short.connect(MONGO_DB);
  18 +
  19 +short.connection.on('open', function() {
  20 + console.log('connected to mongodb');
  21 +});
  22 +
  23 +short.connection.on('error', function(error) {
  24 + throw new Error(error);
  25 +});
18 26
19 27 /*!
20   - Vows / npm test
  28 + add suites to vows
21 29 */
22 30
23 31 vows.describe('general module tests').addBatch({

0 comments on commit f48c1bf

Please sign in to comment.
Something went wrong with that request. Please try again.