Permalink
Browse files

added totp test for initial_time

  • Loading branch information...
1 parent 4936da4 commit 87e786c35b14700a45587ed65004c70c0178317d @markbao markbao committed Nov 3, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 test/test_totp.js
View
@@ -67,4 +67,14 @@ vows.describe('TOTP Time-Based Algorithm Test').addBatch({
assert.equal(topic, '360094');
}
},
+
+ 'Test initial time with key = \'12345678901234567890\' at time = 1111111109 and initial time = 1111111100': {
+ topic: function() {
+ return speakeasy.totp({key: '12345678901234567890', time: 1111111109, initial_time: 1111111100});
+ },
+
+ 'correct one-time password returned': function(topic) {
+ assert.equal(topic, '755224');
+ }
+ },
}).exportTo(module);

0 comments on commit 87e786c

Please sign in to comment.