From caf0093c2cc96734153d30f3f98bde0be071fca4 Mon Sep 17 00:00:00 2001 From: freewil Date: Mon, 7 Apr 2014 03:04:36 -0700 Subject: [PATCH 1/2] remove node v0.4.x support --- .travis.yml | 6 ++++-- Readme.md | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1d0f13..853e369 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: node_js node_js: - - 0.4 - - 0.6 + - "0.6" + - "0.8" + - "0.10" + - "0.11" diff --git a/Readme.md b/Readme.md index d5e898e..f4da48d 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,4 @@ -[![Build Status](https://secure.travis-ci.org/guyht/notp.png)](http://travis-ci.org/guyht/notp) +[![Build Status](https://travis-ci.org/guyht/notp.svg)](https://travis-ci.org/guyht/notp) # Node One Time Password library Simple to use, fast, and with zero dependencies. The Node One Time Password library is fully compliant with [HOTP](http://tools.ietf.org/html/rfc4226) (counter based one time passwords) and [TOTP](http://tools.ietf.org/html/rfc6238) (time based one time passwords). It can be used in conjunction with the [Google Authenticator](http://code.google.com/p/google-authenticator/) which has free apps for iOS, Android and BlackBerry. diff --git a/package.json b/package.json index c013e37..5ae9cf5 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "test": "expresso" }, "engines": { - "node": ">= v0.4.10" + "node": ">= v0.6.0" }, "dependencies": {}, "devDependencies": { From 3873e43f39fbb69394952ab2528c20c724ad18fe Mon Sep 17 00:00:00 2001 From: freewil Date: Mon, 7 Apr 2014 03:13:09 -0700 Subject: [PATCH 2/2] replace expresso with mocha --- package.json | 4 ++-- test/mocha.opts | 1 + test/notp.js | 34 +++++++++++++++++----------------- 3 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 test/mocha.opts diff --git a/package.json b/package.json index 5ae9cf5..a42ba8a 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,13 @@ }, "main": "index.js", "scripts": { - "test": "expresso" + "test": "mocha" }, "engines": { "node": ">= v0.6.0" }, "dependencies": {}, "devDependencies": { - "expresso" : "0.9.0" + "mocha": "~1.18.2" } } diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 0000000..e3ca00a --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1 @@ +--ui exports diff --git a/test/notp.js b/test/notp.js index bd20e80..ef04f61 100644 --- a/test/notp.js +++ b/test/notp.js @@ -1,5 +1,5 @@ - var notp = require('..'); +var assert = require('assert'); /* * Test HOTtoken. Uses test values from RFcounter 4226 @@ -43,7 +43,7 @@ var notp = require('..'); * * see http://tools.ietf.org/html/rfc4226 */ -exports.testHOTP = function(beforeExit, assert) { +exports.testHOTP = function() { var key = '12345678901234567890'; var opt = { window : 0, @@ -60,7 +60,7 @@ exports.testHOTP = function(beforeExit, assert) { var res = notp.hotp.verify(HOTP[i], key, opt); assert.ok(res, 'Should pass'); - assert.eql(res.delta, 0, 'Should be in sync'); + assert.equal(res.delta, 0, 'Should be in sync'); } }; @@ -70,7 +70,7 @@ exports.testHOTP = function(beforeExit, assert) { * * see http://tools.ietf.org/id/draft-mraihi-totp-timebased-06.txt */ -exports.testTOTtoken = function(beforeExit, assert) { +exports.testTOTtoken = function() { var key = '12345678901234567890'; var opt = { window : 0, @@ -86,28 +86,28 @@ exports.testTOTtoken = function(beforeExit, assert) { var token = '287082'; var res = notp.totp.verify(token, key, opt); assert.ok(res, 'Should pass'); - assert.eql(res.delta, 0, 'Should be in sync'); + assert.equal(res.delta, 0, 'Should be in sync'); // counterheck for test vector at 1234567890 opt._t = 1234567890*1000; var token = '005924'; var res = notp.totp.verify(token, key, opt); assert.ok(res, 'Should pass'); - assert.eql(res.delta, 0, 'Should be in sync'); + assert.equal(res.delta, 0, 'Should be in sync'); // counterheck for test vector at 1111111109 opt._t = 1111111109*1000; var token = '081804'; var res = notp.totp.verify(token, key, opt); assert.ok(res, 'Should pass'); - assert.eql(res.delta, 0, 'Should be in sync'); + assert.equal(res.delta, 0, 'Should be in sync'); // counterheck for test vector at 2000000000 opt._t = 2000000000*1000; var token = '279037'; var res = notp.totp.verify(token, key, opt); assert.ok(res, 'Should pass'); - assert.eql(res.delta, 0, 'Should be in sync'); + assert.equal(res.delta, 0, 'Should be in sync'); }; @@ -116,7 +116,7 @@ exports.testTOTtoken = function(beforeExit, assert) { * windowe are going to use a value of counter = 1 and test against * a code for counter = 9 */ -exports.testHOTPOutOfSync = function(beforeExit, assert) { +exports.testHOTPOutOfSync = function() { var key = '12345678901234567890'; var token = '520489'; @@ -145,7 +145,7 @@ exports.testHOTPOutOfSync = function(beforeExit, assert) { * counterheck for codes that are out of sync * windowe are going to use a value of T = 1999999909 (91s behind 2000000000) */ -exports.testTOTPOutOfSync = function(beforeExit, assert) { +exports.testTOTPOutOfSync = function() { var key = '12345678901234567890'; var token = '279037'; @@ -164,7 +164,7 @@ exports.testTOTPOutOfSync = function(beforeExit, assert) { }; -exports.hotp_gen = function(beforeExit, assert) { +exports.hotp_gen = function() { var key = '12345678901234567890'; var opt = { window : 0, @@ -175,12 +175,12 @@ exports.hotp_gen = function(beforeExit, assert) { // counterheck for passes for(i=0;i