Skip to content

Commit

Permalink
Update dependencies used for running tests (#518)
Browse files Browse the repository at this point in the history
Update chai and mocha to the latest versions and update nyc to the
latest version that supports Node 4.
  • Loading branch information
MitMaro authored and ziluvatar committed Sep 10, 2018
1 parent 877bd57 commit 5498bdc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
},
"devDependencies": {
"atob": "^1.1.2",
"chai": "^1.10.0",
"chai": "^4.1.2",
"conventional-changelog": "~1.1.0",
"cost-of-modules": "^1.0.1",
"eslint": "^4.19.1",
"mocha": "^2.1.0",
"mocha": "^5.2.0",
"nsp": "^2.6.2",
"nyc": "^11.8.0",
"nyc": "^11.9.0",
"sinon": "^6.0.0"
},
"engines": {
Expand Down
12 changes: 6 additions & 6 deletions test/async_sign.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ describe('signing a token asynchronously', function() {

it('should work with empty options', function (done) {
jwt.sign({abc: 1}, "secret", {}, function (err) {
expect(err).to.be.null();
expect(err).to.be.null;
done();
});
});

it('should work without options object at all', function (done) {
jwt.sign({abc: 1}, "secret", function (err) {
expect(err).to.be.null();
expect(err).to.be.null;
done();
});
});
Expand All @@ -53,22 +53,22 @@ describe('signing a token asynchronously', function() {
it('should return error when secret is not a cert for RS256', function(done) {
//this throw an error because the secret is not a cert and RS256 requires a cert.
jwt.sign({ foo: 'bar' }, secret, { algorithm: 'RS256' }, function (err) {
expect(err).to.be.ok();
expect(err).to.be.ok;
done();
});
});

it('should return error on wrong arguments', function(done) {
//this throw an error because the secret is not a cert and RS256 requires a cert.
jwt.sign({ foo: 'bar' }, secret, { notBefore: {} }, function (err) {
expect(err).to.be.ok();
expect(err).to.be.ok;
done();
});
});

it('should return error on wrong arguments (2)', function(done) {
jwt.sign('string', 'secret', {noTimestamp: true}, function (err) {
expect(err).to.be.ok();
expect(err).to.be.ok;
expect(err).to.be.instanceof(Error);
done();
});
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('signing a token asynchronously', function() {
it('should return an error if the secret is falsy and algorithm is not set to none: ' + (typeof secret === 'string' ? '(empty string)' : secret), function(done) {
// This is needed since jws will not answer for falsy secrets
jwt.sign('string', secret, {}, function(err, token) {
expect(err).to.be.exist();
expect(err).to.exist;
expect(err.message).to.equal('secretOrPrivateKey must have a value');
expect(token).to.not.exist;
done();
Expand Down

0 comments on commit 5498bdc

Please sign in to comment.