From 71e735517ae126d3ab09ecb9aed79adbdce3fd4b Mon Sep 17 00:00:00 2001 From: Matt Loring Date: Fri, 18 Mar 2016 12:56:58 -0700 Subject: [PATCH] Support for hapi 11 --- lib/hooks/userspace/hook-hapi.js | 2 +- test/hooks/fixtures/hapi11/index.js | 1 + test/hooks/fixtures/hapi11/package.json | 8 ++++++++ test/hooks/test-trace-hapi.js | 6 +++++- 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 test/hooks/fixtures/hapi11/index.js create mode 100644 test/hooks/fixtures/hapi11/package.json diff --git a/lib/hooks/userspace/hook-hapi.js b/lib/hooks/userspace/hook-hapi.js index d7f900a9f..74c778f54 100644 --- a/lib/hooks/userspace/hook-hapi.js +++ b/lib/hooks/userspace/hook-hapi.js @@ -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() { diff --git a/test/hooks/fixtures/hapi11/index.js b/test/hooks/fixtures/hapi11/index.js new file mode 100644 index 000000000..cb05a97e8 --- /dev/null +++ b/test/hooks/fixtures/hapi11/index.js @@ -0,0 +1 @@ +module.exports = require('hapi'); diff --git a/test/hooks/fixtures/hapi11/package.json b/test/hooks/fixtures/hapi11/package.json new file mode 100644 index 000000000..a811ccb63 --- /dev/null +++ b/test/hooks/fixtures/hapi11/package.json @@ -0,0 +1,8 @@ +{ + "name": "hapi11", + "version": "1.0.0", + "main": "index.js", + "dependencies": { + "hapi": "^11.1.4" + } +} diff --git a/test/hooks/test-trace-hapi.js b/test/hooks/test-trace-hapi.js index d6169c1e5..e8f60ddbf 100644 --- a/test/hooks/test-trace-hapi.js +++ b/test/hooks/test-trace-hapi.js @@ -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) { @@ -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 });