@@ -8,31 +8,21 @@ const {
88 spawnPluginIntegrationTestProc
99} = require ( '../../../../integration-tests/helpers' )
1010const { assert } = require ( 'chai' )
11- const { NODE_MAJOR } = require ( '../../../../version' )
1211
1312const hookFile = 'dd-trace/loader-hook.mjs'
1413
15- const BUILD_COMMAND = NODE_MAJOR < 18
16- ? 'yarn exec next build'
17- : 'NODE_OPTIONS=--openssl-legacy-provider yarn exec next build'
18- const NODE_OPTIONS = NODE_MAJOR < 18
19- ? `--loader=${ hookFile } --require dd-trace/init`
20- : `--loader=${ hookFile } --require dd-trace/init --openssl-legacy-provider`
21-
22- const VERSIONS_TO_TEST = NODE_MAJOR < 18 ? '>=11.1 <13.2' : '>=11.1'
23-
2414describe ( 'esm' , ( ) => {
2515 let agent
2616 let proc
2717 let sandbox
2818 // match versions tested with unit tests
29- withVersions ( 'next' , 'next' , VERSIONS_TO_TEST , version => {
19+ withVersions ( 'next' , 'next' , '>=11.1' , version => {
3020 before ( async function ( ) {
3121 // next builds slower in the CI, match timeout with unit tests
3222 this . timeout ( 120 * 1000 )
3323 sandbox = await createSandbox ( [ `'next@${ version } '` , 'react@^18.2.0' , 'react-dom@^18.2.0' ] ,
3424 false , [ './packages/datadog-plugin-next/test/integration-test/*' ] ,
35- BUILD_COMMAND )
25+ 'NODE_OPTIONS=--openssl-legacy-provider yarn exec next build' )
3626 } )
3727
3828 after ( async ( ) => {
@@ -50,7 +40,7 @@ describe('esm', () => {
5040
5141 it ( 'is instrumented' , async ( ) => {
5242 proc = await spawnPluginIntegrationTestProc ( sandbox . folder , 'server.mjs' , agent . port , undefined , {
53- NODE_OPTIONS
43+ NODE_OPTIONS : `--loader= ${ hookFile } --require dd-trace/init --openssl-legacy-provider`
5444 } )
5545 return curlAndAssertMessage ( agent , proc , ( { headers, payload } ) => {
5646 assert . propertyVal ( headers , 'host' , `127.0.0.1:${ agent . port } ` )
0 commit comments