Files
node-jsonwebtoken/test/non_object_values.tests.js
T
Tim OramandEduardo Diaz 86a39e7e9e Refactor tests related to audience and aud (#503)
This change extracts all tests in the existing test files related to
audience and aud into a single test file. Several other tests are also
added that were missing from the existing files.
2018-07-12 14:36:35 +02:00

19 lines
470 B
JavaScript

var jwt = require('../index');
var expect = require('chai').expect;
describe('non_object_values values', function() {
it('should work with string', function () {
var token = jwt.sign('hello', '123');
var result = jwt.verify(token, '123');
expect(result).to.equal('hello');
});
it('should work with number', function () {
var token = jwt.sign(123, '123');
var result = jwt.verify(token, '123');
expect(result).to.equal('123');
});
});