Skip to content

Commit 34f19d5

Browse files
authored
[test-optimization] [SDTEST-1870] Add support for Playwright >= 1.52.0 (#5595)
1 parent 646d8c2 commit 34f19d5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/datadog-instrumentations/src/playwright.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,17 @@ addHook({
761761
return rootSuite
762762
}
763763

764-
loadUtilsPackage.createRootSuite = newCreateRootSuite
764+
// We need to proxy the createRootSuite function because the function is not configurable
765+
const proxy = new Proxy(loadUtilsPackage, {
766+
get (target, prop) {
767+
if (prop === 'createRootSuite') {
768+
return newCreateRootSuite
769+
}
770+
return target[prop]
771+
}
772+
})
765773

766-
return loadUtilsPackage
774+
return proxy
767775
})
768776

769777
// main process hook

0 commit comments

Comments
 (0)