Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Filippo Conti committed Jan 31, 2019
1 parent 9432129 commit 0fe379d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const responses = require('./responses.json');
describe('Pwned API Test Suite:', () => {
let Pwner;
beforeAll(() => {
Pwner = new Pwned();
Pwner = new Pwned({
agent: 'Node-Pwned-Test-Suite'
});
});

it('calls the breach API endpoint', done => {
Expand Down Expand Up @@ -57,10 +59,7 @@ describe('Pwned API Test Suite:', () => {
it('calls the pwnedpassword API endpoint', done => {
mock.get('/pwnedpassword/P@55w0rd?').reply(200);
Pwner.pwnedPassword('P@55w0rd', {}, (err, res) => {
assert(
!err && (Object.keys(res).length === 0 && res.constructor === Object),
'It should respond empty body'
);
assert(!err && res === '', 'It should respond empty body');
done();
});
});
Expand Down

0 comments on commit 0fe379d

Please sign in to comment.