You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
376 B

  1. var jwt = require('../index');
  2. var expect = require('chai').expect;
  3. describe('noTimestamp', function() {
  4. it('should work with string', function () {
  5. var token = jwt.sign({foo: 123}, '123', { expiresIn: '5m' , noTimestamp: true });
  6. var result = jwt.verify(token, '123');
  7. expect(result.exp).to.be.closeTo(Math.floor(Date.now() / 1000) + (5*60), 0.5);
  8. });
  9. });