Skip to content

Commit 29ebdad

Browse files
authored
update hapi tests to only test versions supported on current node (#3139)
1 parent e377c40 commit 29ebdad

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/plugins.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ jobs:
353353
- run: yarn test:plugins:ci
354354
- uses: codecov/codecov-action@v2
355355

356-
# The hapi version ranges we support only support up to Node 14.
357356
hapi:
358357
runs-on: ubuntu-latest
359358
env:
@@ -364,6 +363,8 @@ jobs:
364363
- run: yarn install
365364
- uses: ./.github/actions/node/oldest
366365
- run: yarn test:plugins:ci
366+
- uses: ./.github/actions/node/latest
367+
- run: yarn test:plugins:ci
367368
- uses: codecov/codecov-action@v2
368369

369370
http:

packages/datadog-plugin-hapi/test/index.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ const semver = require('semver')
66
const agent = require('../../dd-trace/test/plugins/agent')
77
const { ERROR_MESSAGE, ERROR_TYPE, ERROR_STACK } = require('../../dd-trace/src/constants')
88

9+
const versionRange = parseInt(process.versions.node.split('.')[0]) > 14
10+
? '<17 || >18'
11+
: ''
12+
913
describe('Plugin', () => {
1014
let tracer
1115
let Hapi
@@ -15,7 +19,7 @@ describe('Plugin', () => {
1519
let reply
1620

1721
describe('hapi', () => {
18-
withVersions('hapi', ['hapi', '@hapi/hapi'], (version, module) => {
22+
withVersions('hapi', ['hapi', '@hapi/hapi'], versionRange, (version, module) => {
1923
beforeEach(() => {
2024
tracer = require('../../dd-trace')
2125
handler = (request, h, body) => h.response ? h.response(body) : h(body)

0 commit comments

Comments
 (0)