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