Files
jsotp/test/hotp_test.js
T
2017-06-30 14:21:19 +08:00

22 lines
578 B
JavaScript

var hotp = require('../lib/hotp');
var assert = require('assert');
describe('HOTP module test', function() {
var HOTP = hotp.HOTP;
var a = new HOTP("J22U6B3WIWRRBTAV");
describe('at() function', function() {
it("should return string", function() {
assert.equal("string", typeof(a.at(0)));
});
});
describe('verify() function', function() {
it("should verify the digit", function() {
assert.equal(true, a.verify(a.at(0), 0));
assert.equal(false, a.verify(a.at(0), 1));
})
})
});