Skip to content

Commit

Permalink
ref(sdk): Update to be compatible with Sentry SDK v7
Browse files Browse the repository at this point in the history
It looks like we were using a deprecated 'child()' syntax, see getsentry/sentry-javascript#4849.
  • Loading branch information
k-fish committed May 10, 2022
1 parent 0f65a3d commit 2e2ec16
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions createEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ function createEnvironment({ baseEnvironment } = {}) {
beforeFinish: (span) => {
const parent = this.testContainers.get(this.getName(event.test));
if (parent && !Array.isArray(parent)) {
return parent.child(span);
return parent.startChild(span);
} else if (Array.isArray(parent)) {
return parent.find(isNotTransaction).child(span);
return parent.find(isNotTransaction).startChild(span);
}
return span;
},
Expand Down Expand Up @@ -241,11 +241,9 @@ function createEnvironment({ baseEnvironment } = {}) {
? parentStore
.get(parentName)
.map((s) =>
typeof s.child === "function"
? s.child(spanProps)
: s.startChild(spanProps)
s.startChild(spanProps
)
: [parentStore.get(parentName).child(spanProps)]
: [parentStore.get(parentName).startChild(spanProps)]
: [this.transaction.startChild(spanProps)];

spans.push(...span);
Expand Down

0 comments on commit 2e2ec16

Please sign in to comment.