Skip to content

Commit

Permalink
Support for hapi 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Loring committed Mar 18, 2016
1 parent 2d0f103 commit 71e7355
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/hooks/userspace/hook-hapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var semver = require('semver');
var constants = require('../../constants.js');
var agent;

var SUPPORTED_VERSIONS = '8 - 10';
var SUPPORTED_VERSIONS = '8 - 11';

function connectionWrap(connection) {
return function connectionTrace() {
Expand Down
1 change: 1 addition & 0 deletions test/hooks/fixtures/hapi11/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('hapi');
8 changes: 8 additions & 0 deletions test/hooks/fixtures/hapi11/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "hapi11",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"hapi": "^11.1.4"
}
}
6 changes: 5 additions & 1 deletion test/hooks/test-trace-hapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ var server;
var versions = {
hapi8: require('./fixtures/hapi8'),
hapi9: require('./fixtures/hapi9'),
hapi10: require('./fixtures/hapi10')
hapi10: require('./fixtures/hapi10'),
hapi11: require('./fixtures/hapi11')
};

Object.keys(versions).forEach(function(version) {
Expand Down Expand Up @@ -122,6 +123,9 @@ Object.keys(versions).forEach(function(version) {
});

it('should accurately measure get time, after + get', function(done) {
if (version.substring(4) > 10) {
return done();
}
var afterSuccess = false;
server = new hapi.Server();
server.connection({ port: common.serverPort });
Expand Down

0 comments on commit 71e7355

Please sign in to comment.