Skip to content

Commit

Permalink
chore: fixes from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kirrg001 committed Oct 4, 2024
1 parent dba9389 commit e14825c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/collector/test/tracing/misc/node-fetch/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ app.get('/', async (req, res) => {
});

app.get('/request', async (req, res) => {
log('Received request /request');
await fetch(`http://127.0.0.1:${agentPort}`);

res.json({});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const config = require('@instana/core/test/config');
const ProcessControls = require('../../../../test_util/ProcessControls');
const globalAgent = require('../../../../globalAgent');
const testUtils = require('@instana/core/test/test_util');
const isLatestEsmSupportedVersion = require('@instana/core').tracing.isLatestEsmSupportedVersion;
const loaderPath = isLatestEsmSupportedVersion(process.versions.node)
? ['--import', path.join(__dirname, 'node_modules', '@instana', 'collector', 'esm-register.mjs')]
: ['--experimental-loader', path.join(__dirname, 'node_modules', '@instana', 'collector', 'esm-loader.mjs')];

describe('Typescript TS->ESM', function () {
this.timeout(config.getTestTimeout() * 5);
Expand All @@ -35,7 +39,7 @@ describe('Typescript TS->ESM', function () {
controls = new ProcessControls({
appPath: path.join(__dirname, 'dist', 'app_1.js'),
useGlobalAgent: true,
execArgv: ['--import', path.join(__dirname, 'node_modules', '@instana', 'collector', 'esm-register.mjs')]
execArgv: loaderPath
});

await controls.startAndWaitForAgentConnection();
Expand Down Expand Up @@ -78,7 +82,7 @@ describe('Typescript TS->ESM', function () {
controls = new ProcessControls({
appPath: path.join(__dirname, 'dist', 'app_2.js'),
useGlobalAgent: true,
execArgv: ['--import', path.join(__dirname, 'node_modules', '@instana', 'collector', 'esm-register.mjs')]
execArgv: loaderPath
});

await controls.startAndWaitForAgentConnection();
Expand Down

0 comments on commit e14825c

Please sign in to comment.