Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

Commit

Permalink
add test enforcing X-NSP-VERSION header in request
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Mar 29, 2016
1 parent f755d21 commit 1f032f9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var Lab = require('lab');
var Nock = require('nock');
var Path = require('path');
var Check = require('../lib/check.js');
var Pkg = require('../package.json');

var lab = exports.lab = Lab.script();
var describe = lab.describe;
Expand Down Expand Up @@ -248,5 +249,22 @@ describe('check', function () {
});
});

it('Includes X-NSP-VERSION in headers', function (done) {

Nock('https://api.nodesecurity.io', {
reqheaders: {
'X-NSP-VERSION': Pkg.version
}
})
.post('/check')
.reply(200, Findings);

Check(workingOptions, function (err, results) {

expect(err).to.not.exist();
done();
});
});


});

0 comments on commit 1f032f9

Please sign in to comment.