Skip to content

Commit

Permalink
Start porting tests to Mocha.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Feb 3, 2016
1 parent f9c2144 commit 7b7b97a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Makefile
@@ -1,12 +1,13 @@
WITH_VOWS = 1
include node_modules/make-node/main.mk


SOURCES = lib/**/*.js
TESTS = test/*-test.js
SOURCES = lib/*.js lib/**/*.js
TESTS = test/*.test.js

LCOVFILE = ./reports/coverage/lcov.info

MOCHAFLAGS = --require ./test/bootstrap/node


view-docs:
open ./docs/index.html
Expand Down
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -36,7 +36,10 @@
},
"devDependencies": {
"make-node": "0.3.x",
"vows": "0.7.x"
"vows": "0.7.x",
"mocha": "1.x.x",
"chai": "2.x.x",
"chai-passport-strategy": "1.x.x"
},
"engines": {
"node": ">= 0.4.0"
Expand Down
7 changes: 7 additions & 0 deletions test/bootstrap/node.js
@@ -0,0 +1,7 @@
var chai = require('chai')
, passport = require('chai-passport-strategy');

chai.use(passport);


global.expect = chai.expect;
21 changes: 21 additions & 0 deletions test/strategy.test.js
@@ -0,0 +1,21 @@
/* global describe, it, expect */
/* jshint expr: true */

var GoogleStrategy = require('../lib/oauth2')
, chai = require('chai');


describe('Strategy', function() {

describe('constructed', function() {
var strategy = new GoogleStrategy({
clientID: 'ABC123',
clientSecret: 'secret'
}, function() {});

it('should be named google', function() {
expect(strategy.name).to.equal('google');
});
})

});

0 comments on commit 7b7b97a

Please sign in to comment.