From 7b0981380ddc40a5f1208df520631785b5ffb85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20F=2E=20Romaniello?= Date: Fri, 29 Apr 2016 08:54:48 -0300 Subject: [PATCH] improve async test --- test/async_sign.tests.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/async_sign.tests.js b/test/async_sign.tests.js index 6006ff6..fc3c9d0 100644 --- a/test/async_sign.tests.js +++ b/test/async_sign.tests.js @@ -1,16 +1,15 @@ var jwt = require('../index'); - var expect = require('chai').expect; describe('signing a token asynchronously', function() { describe('when signing a token', function() { var secret = 'shhhhhh'; - var syncToken = jwt.sign({ foo: 'bar' }, secret, { algorithm: 'HS256' }); it('should return the same result as singing synchronously', function(done) { jwt.sign({ foo: 'bar' }, secret, { algorithm: 'HS256' }, function (err, asyncToken) { if (err) return done(err); + var syncToken = jwt.sign({ foo: 'bar' }, secret, { algorithm: 'HS256' }); expect(asyncToken).to.be.a('string'); expect(asyncToken.split('.')).to.have.length(3); expect(asyncToken).to.equal(syncToken);