Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0e04422

Browse files
committedApr 30, 2021
Use the common hapi-version-compat check in this test case as well.
1 parent 4430f84 commit 0e04422

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed
 

‎test/sanitize-field-names/hapi.js

+3-17
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,9 @@ const {
88
} = require('./_shared')
99
const agent = require('../..').start(createAgentConfig())
1010

11-
// Skip out of testing hapi if the current version combo is unsupported.
12-
// (See similar logic in "test/instrumentation/modules/hapi/shared.js".)
13-
const semver = require('semver')
14-
const hapiVersion = require('@hapi/hapi/package.json').version
15-
// - hapi 17+ requires Node.js 8.9.0 or higher
16-
if (semver.lt(process.version, '8.9.0') && semver.gte(hapiVersion, '17.0.0')) {
17-
process.exit()
18-
}
19-
// - hapi 19+ requires Node.js 12 or higher
20-
if (semver.lt(process.version, '12.0.0') && semver.gte(hapiVersion, '19.0.0')) {
21-
process.exit()
22-
}
23-
// - hapi does not work on early versions of Node.js 10 because of
24-
// https://github.com/nodejs/node/issues/20516
25-
// NOTE: Do not use semver.satisfies, as it does not match prereleases
26-
const parsedVer = semver.parse(process.version)
27-
if (parsedVer.major === 10 && parsedVer.minor >= 0 && parsedVer.minor < 8) {
11+
var isHapiIncompat = require('../_is_hapi_incompat')
12+
if (isHapiIncompat('@hapi/hapi')) {
13+
// Skip out of this test.
2814
process.exit()
2915
}
3016

0 commit comments

Comments
 (0)
Please sign in to comment.