Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci-visibility] Fix cucumber plugin tests for node<16 #3902

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading