@@ -8,31 +8,21 @@ const {
8
8
spawnPluginIntegrationTestProc
9
9
} = require ( '../../../../integration-tests/helpers' )
10
10
const { assert } = require ( 'chai' )
11
- const { NODE_MAJOR } = require ( '../../../../version' )
12
11
13
12
const hookFile = 'dd-trace/loader-hook.mjs'
14
13
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
-
24
14
describe ( 'esm' , ( ) => {
25
15
let agent
26
16
let proc
27
17
let sandbox
28
18
// match versions tested with unit tests
29
- withVersions ( 'next' , 'next' , VERSIONS_TO_TEST , version => {
19
+ withVersions ( 'next' , 'next' , '>=11.1' , version => {
30
20
before ( async function ( ) {
31
21
// next builds slower in the CI, match timeout with unit tests
32
22
this . timeout ( 120 * 1000 )
33
23
sandbox = await createSandbox ( [ `'next@${ version } '` , 'react@^18.2.0' , 'react-dom@^18.2.0' ] ,
34
24
false , [ './packages/datadog-plugin-next/test/integration-test/*' ] ,
35
- BUILD_COMMAND )
25
+ 'NODE_OPTIONS=--openssl-legacy-provider yarn exec next build' )
36
26
} )
37
27
38
28
after ( async ( ) => {
@@ -50,7 +40,7 @@ describe('esm', () => {
50
40
51
41
it ( 'is instrumented' , async ( ) => {
52
42
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`
54
44
} )
55
45
return curlAndAssertMessage ( agent , proc , ( { headers, payload } ) => {
56
46
assert . propertyVal ( headers , 'host' , `127.0.0.1:${ agent . port } ` )
0 commit comments