-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
dev-packages/e2e-tests/test-applications/node-profiling/index.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as Sentry from '@sentry/node'; | ||
import { nodeProfilingIntegration } from '@sentry/profiling-node'; | ||
|
||
const wait = ms => new Promise(resolve => setTimeout(resolve, ms)); | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/6625302', | ||
integrations: [nodeProfilingIntegration()], | ||
tracesSampleRate: 1.0, | ||
profilesSampleRate: 1.0, | ||
}); | ||
|
||
Sentry.startSpan({ name: 'Precompile test' }, async () => { | ||
await wait(500); | ||
}); | ||
|
||
// Test that globalThis.require is not defined by any side effects of the profiling | ||
// https://github.com/getsentry/sentry-javascript/issues/13662 | ||
if (globalThis.require !== undefined) { | ||
throw new Error('globalThis.require should not be defined, check that profiling integration is not defining it'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters