Skip to content

Commit

Permalink
[ci-visibility] Fix cucumber plugin tests for node<16 (#3902)
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez authored and khanayan123 committed Jan 2, 2024
1 parent ea7dc17 commit 213bef3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/datadog-plugin-cucumber/test/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'
const path = require('path')
const { PassThrough } = require('stream')
const semver = require('semver')

const proxyquire = require('proxyquire').noPreserveCache()
const nock = require('nock')
Expand All @@ -23,6 +24,7 @@ const {
TEST_SOURCE_START
} = require('../../dd-trace/src/plugins/util/test')

const { NODE_MAJOR } = require('../../../version')
const { version: ddTraceVersion } = require('../../../package.json')

const runCucumber = (version, Cucumber, requireName, featureName, testName) => {
Expand Down Expand Up @@ -54,6 +56,9 @@ describe('Plugin', function () {
let Cucumber
this.timeout(10000)
withVersions('cucumber', '@cucumber/cucumber', version => {
const specificVersion = require(`../../../versions/@cucumber/cucumber@${version}`).version()
if ((NODE_MAJOR <= 16) && semver.satisfies(specificVersion, '>=10')) return

afterEach(() => {
// > If you want to run tests multiple times, you may need to clear Node's require cache
// before subsequent calls in whichever manner best suits your needs.
Expand Down

0 comments on commit 213bef3

Please sign in to comment.