mirror of
https://github.com/LanceGin/jsotp.git
synced 2024-10-06 06:22:08 +08:00
28 lines
761 B
JavaScript
28 lines
761 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(parseInt(a.at(0)), 0));
|
|
assert.equal(false, a.verify(a.at(0), 1));
|
|
})
|
|
});
|
|
|
|
describe('url_gen() function', function() {
|
|
it("should return string", function() {
|
|
assert.equal("string", typeof(a.url_gen()));
|
|
})
|
|
})
|
|
});
|