Skip to content

Commit 7b7b97a

Browse files
committed
Start porting tests to Mocha.
1 parent f9c2144 commit 7b7b97a

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
WITH_VOWS = 1
21
include node_modules/make-node/main.mk
32

43

5-
SOURCES = lib/**/*.js
6-
TESTS = test/*-test.js
4+
SOURCES = lib/*.js lib/**/*.js
5+
TESTS = test/*.test.js
76

87
LCOVFILE = ./reports/coverage/lcov.info
98

9+
MOCHAFLAGS = --require ./test/bootstrap/node
10+
1011

1112
view-docs:
1213
open ./docs/index.html

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
},
3737
"devDependencies": {
3838
"make-node": "0.3.x",
39-
"vows": "0.7.x"
39+
"vows": "0.7.x",
40+
"mocha": "1.x.x",
41+
"chai": "2.x.x",
42+
"chai-passport-strategy": "1.x.x"
4043
},
4144
"engines": {
4245
"node": ">= 0.4.0"

test/bootstrap/node.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var chai = require('chai')
2+
, passport = require('chai-passport-strategy');
3+
4+
chai.use(passport);
5+
6+
7+
global.expect = chai.expect;

test/strategy.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* global describe, it, expect */
2+
/* jshint expr: true */
3+
4+
var GoogleStrategy = require('../lib/oauth2')
5+
, chai = require('chai');
6+
7+
8+
describe('Strategy', function() {
9+
10+
describe('constructed', function() {
11+
var strategy = new GoogleStrategy({
12+
clientID: 'ABC123',
13+
clientSecret: 'secret'
14+
}, function() {});
15+
16+
it('should be named google', function() {
17+
expect(strategy.name).to.equal('google');
18+
});
19+
})
20+
21+
});

0 commit comments

Comments
 (0)