tests for not passing opt
we just want those to not throw an error, which is why there's no assertions
This commit is contained in:
parent
a653c7e624
commit
1556427b39
12
test/notp.js
12
test/notp.js
@ -50,6 +50,9 @@ exports.testHOTP = function() {
|
||||
};
|
||||
var HOTP = ['755224', '287082','359152', '969429', '338314', '254676', '287922', '162583', '399871', '520489'];
|
||||
|
||||
// make sure we can not pass in opt
|
||||
notp.hotp.verify('WILL NOT PASS', key);
|
||||
|
||||
// counterheck for failure
|
||||
opt.counter = 0;
|
||||
assert.ok(!notp.hotp.verify('WILL NOT PASS', key, opt), 'Should not pass');
|
||||
@ -76,6 +79,9 @@ exports.testTOTtoken = function() {
|
||||
window : 0,
|
||||
};
|
||||
|
||||
// make sure we can not pass in opt
|
||||
notp.totp.verify(token, key);
|
||||
|
||||
// counterheck for failure
|
||||
opt.time = 0;
|
||||
var token = 'windowILLNOTtokenASS';
|
||||
@ -172,6 +178,9 @@ exports.hotp_gen = function() {
|
||||
|
||||
var HOTP = ['755224', '287082','359152', '969429', '338314', '254676', '287922', '162583', '399871', '520489'];
|
||||
|
||||
// make sure we can not pass in opt
|
||||
notp.hotp.gen(key);
|
||||
|
||||
// counterheck for passes
|
||||
for(i=0;i<HOTP.length;i++) {
|
||||
opt.counter = i;
|
||||
@ -186,6 +195,9 @@ exports.totp_gen = function() {
|
||||
window : 0,
|
||||
};
|
||||
|
||||
// make sure we can not pass in opt
|
||||
notp.totp.gen(key);
|
||||
|
||||
// counterheck for test vector at 59s
|
||||
opt._t = 59*1000;
|
||||
assert.equal(notp.totp.gen(key, opt), '287082', 'TOTtoken values should match');
|
||||
|
Loading…
x
Reference in New Issue
Block a user