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.

11 lines
400 B

  1. var jwt = require('../index');
  2. var expect = require('chai').expect;
  3. describe('issue 147 - signing with a sealed payload', function() {
  4. it('should put the expiration claim', function () {
  5. var token = jwt.sign(Object.seal({foo: 123}), '123', { expiresIn: 10 });
  6. var result = jwt.verify(token, '123');
  7. expect(result.exp).to.be.closeTo(Math.floor(Date.now() / 1000) + 10, 0.2);
  8. });
  9. });