Skip to content

Commit 79314fe

Browse files
committed
set type module before running test
1 parent 6ac71f9 commit 79314fe

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dev-packages/e2e-tests/test-applications/node-profiling/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// breaks our runtime detection and can break instrumentation
33
// https://github.com/getsentry/sentry-javascript/issues/14525#issuecomment-2511208064
44

5-
function assertUnpatechedRequire(cycle) {
6-
if (globalThis.require !== undefined) {
5+
function assertUnpatechedRequire() {
6+
if (typeof globalThis.require !== 'undefined') {
77
// Test that globalThis.require is not defined by any side effects of the profiling
88
// https://github.com/getsentry/sentry-javascript/issues/13662
99
throw new Error(

dev-packages/e2e-tests/test-applications/node-profiling/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
"scripts": {
66
"typecheck": "tsc --noEmit",
77
"build": "node build.mjs && node build.shimmed.mjs",
8-
"test": "node dist/index.js && node --experimental-require-module dist/index.js && node dist/index.shimmed.mjs && node index.mjs",
8+
"test": "node dist/index.js && node --experimental-require-module dist/index.js && node dist/index.shimmed.mjs && pnpm run test:mjs",
99
"clean": "npx rimraf node_modules dist",
1010
"test:electron": "$(pnpm bin)/electron-rebuild && playwright test",
1111
"test:build": "pnpm run typecheck && pnpm run build",
12-
"test:assert": "pnpm run test && pnpm run test:electron"
12+
"test:assert": "pnpm run test && pnpm run test:electron",
13+
"test:mjs": "node --version && npm pkg set type=module && node index.mjs"
1314
},
1415
"dependencies": {
1516
"@electron/rebuild": "^3.7.0",
@@ -19,7 +20,6 @@
1920
"@sentry/profiling-node": "latest || *",
2021
"electron": "^33.2.0"
2122
},
22-
"devDependencies": {},
2323
"volta": {
2424
"extends": "../../package.json"
2525
},

0 commit comments

Comments
 (0)