Skip to content

Update dependencies used for running tests #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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