Skip to content

Commit b9951a6

Browse files
authored
Merge pull request #23 from getsentry/jest-29
feat: work with jest 29, remove sentry/tracing
2 parents 2af83f9 + 682a923 commit b9951a6

File tree

4 files changed

+3742
-13
lines changed

4 files changed

+3742
-13
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
uses: actions/checkout@v3
2424
with:
2525
ref: ${{ env.HEAD_COMMIT }}
26-
- uses: actions/setup-node@v3
26+
- uses: actions/setup-node@v4
2727
with:
28-
node-version: 16
28+
node-version: 22
2929
cache: 'npm'
3030
- name: Install dependencies
3131
run: npm install

createEnvironment.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const Sentry = require("@sentry/node");
2-
require("@sentry/tracing");
32
const {ProfilingIntegration} = require("@sentry/profiling-node");
43

54
let DID_INIT_SENTRY = false;
@@ -9,7 +8,7 @@ function isNotTransaction(span) {
98
}
109

1110
function createEnvironment({ baseEnvironment } = {}) {
12-
const BaseEnvironment = baseEnvironment || require("jest-environment-jsdom");
11+
const BaseEnvironment = baseEnvironment?.TestEnvironment || require("jest-environment-jsdom").TestEnvironment;
1312

1413
return class SentryEnvironment extends BaseEnvironment {
1514
getVmContextSpanStack = [];
@@ -40,6 +39,10 @@ function createEnvironment({ baseEnvironment } = {}) {
4039
init.integrations = [];
4140
}
4241

42+
if (Sentry.autoDiscoverNodePerformanceMonitoringIntegrations) {
43+
integrations.push(...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations())
44+
}
45+
4346
// Add profiling integration
4447
init.integrations.push(new ProfilingIntegration());
4548

0 commit comments

Comments
 (0)