Skip to content

Commit

Permalink
Merge pull request #14 from zemccartney/scoping-update
Browse files Browse the repository at this point in the history
Update deps to new hapi scope
  • Loading branch information
devinivy committed Nov 25, 2019
2 parents 9afce79 + da21aa6 commit 0e71ca0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Underdog brings [HTTP/2 server-push](http://httpwg.org/specs/rfc7540.html#PushRe
```js
const Fs = require('fs');
const Http2 = require('http2');
const Hapi = require('hapi');
const Hapi = require('@hapi/hapi');
const Underdog = require('underdog');

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Hoek = require('hoek');
const Hoek = require('@hapi/hoek');
const Stream = require('stream');
const Package = require('../package');

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "test"
},
"scripts": {
"test": "lab -a code -t 100 -L",
"test": "lab -a @hapi/code -t 100 -L",
"coveralls": "lab -r lcov | coveralls"
},
"repository": {
Expand All @@ -33,17 +33,17 @@
},
"homepage": "https://github.com/hapipal/underdog#readme",
"dependencies": {
"hoek": "6.x.x"
"@hapi/hoek": "6.x.x"
},
"peerDependencies": {
"hapi": ">=18 <19"
"@hapi/hapi": ">=18 <19"
},
"devDependencies": {
"boom": "7.x.x",
"code": "5.x.x",
"@hapi/boom": "7.x.x",
"@hapi/code": "5.x.x",
"@hapi/hapi": "18.x.x",
"@hapi/lab": "19.x.x",
"coveralls": "3.x.x",
"hapi": "18.x.x",
"lab": "18.x.x",
"toys": ">=2.1.1 <3"
}
}
20 changes: 14 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

// Load modules

const Lab = require('lab');
const Code = require('code');
const Hapi = require('hapi');
const Boom = require('boom');
const Lab = require('@hapi/lab');
const Code = require('@hapi/code');
const Hapi = require('@hapi/hapi');
const Boom = require('@hapi/boom');
const Hoek = require('@hapi/hoek');
const Toys = require('toys');
const Http = require('http');
const Https = require('https');
Expand Down Expand Up @@ -1230,15 +1231,22 @@ describe('Underdog', () => {

flags.onCleanup = async () => {

client.destroy();
client.destroy(); // Alternatively, client.close()
await server.stop();
};

const request = client.request({ ':path': '/' });

// Consumes received data, required to trigger req stream's end
// See: https://github.com/nodejs/help/issues/650
request.on('data', Hoek.ignore);

const [headers, [ignore, event]] = await Promise.all([ // eslint-disable-line no-unused-vars
Toys.event(request, 'response'),
Toys.event(server.events, { name: 'request', channels: 'error' }, { error: false, multiple: true })
Toys.event(server.events, { name: 'request', channels: 'error' }, { error: false, multiple: true }),
// Wait for end, so cleanup doesn't force close any connections,
// causing our test to fail w/ an ECONNRESET error
Toys.event(request, 'end')
]);

expect(headers[':status']).to.equal(500);
Expand Down

0 comments on commit 0e71ca0

Please sign in to comment.