Skip to content

Commit 7b09813

Browse files
committedApr 29, 2016
improve async test
1 parent 252110e commit 7b09813

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎test/async_sign.tests.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
var jwt = require('../index');
2-
32
var expect = require('chai').expect;
43

54
describe('signing a token asynchronously', function() {
65

76
describe('when signing a token', function() {
87
var secret = 'shhhhhh';
9-
var syncToken = jwt.sign({ foo: 'bar' }, secret, { algorithm: 'HS256' });
108

119
it('should return the same result as singing synchronously', function(done) {
1210
jwt.sign({ foo: 'bar' }, secret, { algorithm: 'HS256' }, function (err, asyncToken) {
1311
if (err) return done(err);
12+
var syncToken = jwt.sign({ foo: 'bar' }, secret, { algorithm: 'HS256' });
1413
expect(asyncToken).to.be.a('string');
1514
expect(asyncToken.split('.')).to.have.length(3);
1615
expect(asyncToken).to.equal(syncToken);

0 commit comments

Comments
 (0)
Please sign in to comment.