Skip to content

Commit 2e2ec16

Browse files
committed
ref(sdk): Update to be compatible with Sentry SDK v7
It looks like we were using a deprecated 'child()' syntax, see getsentry/sentry-javascript#4849.
1 parent 0f65a3d commit 2e2ec16

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

createEnvironment.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ function createEnvironment({ baseEnvironment } = {}) {
178178
beforeFinish: (span) => {
179179
const parent = this.testContainers.get(this.getName(event.test));
180180
if (parent && !Array.isArray(parent)) {
181-
return parent.child(span);
181+
return parent.startChild(span);
182182
} else if (Array.isArray(parent)) {
183-
return parent.find(isNotTransaction).child(span);
183+
return parent.find(isNotTransaction).startChild(span);
184184
}
185185
return span;
186186
},
@@ -241,11 +241,9 @@ function createEnvironment({ baseEnvironment } = {}) {
241241
? parentStore
242242
.get(parentName)
243243
.map((s) =>
244-
typeof s.child === "function"
245-
? s.child(spanProps)
246-
: s.startChild(spanProps)
244+
s.startChild(spanProps
247245
)
248-
: [parentStore.get(parentName).child(spanProps)]
246+
: [parentStore.get(parentName).startChild(spanProps)]
249247
: [this.transaction.startChild(spanProps)];
250248

251249
spans.push(...span);

0 commit comments

Comments
 (0)