diff options
Diffstat (limited to 'cli/js')
-rw-r--r-- | cli/js/40_testing.js | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/cli/js/40_testing.js b/cli/js/40_testing.js index 2702dccf1..cf779ee07 100644 --- a/cli/js/40_testing.js +++ b/cli/js/40_testing.js @@ -769,22 +769,8 @@ function testInner( // Delete this prop in case the user passed it. It's used to detect steps. delete testDesc.parent; - const jsError = core.destructureError(new Error()); - let location; - for (let i = 0; i < jsError.frames.length; i++) { - const filename = jsError.frames[i].fileName; - if (filename.startsWith("ext:") || filename.startsWith("node:")) { - continue; - } - location = { - fileName: jsError.frames[i].fileName, - lineNumber: jsError.frames[i].lineNumber, - columnNumber: jsError.frames[i].columnNumber, - }; - break; - } - testDesc.location = location; + testDesc.location = core.currentUserCallSite(); testDesc.fn = wrapTest(testDesc); testDesc.name = escapeName(testDesc.name); @@ -1307,12 +1293,7 @@ function createTestContext(desc) { stepDesc.sanitizeOps ??= desc.sanitizeOps; stepDesc.sanitizeResources ??= desc.sanitizeResources; stepDesc.sanitizeExit ??= desc.sanitizeExit; - const jsError = core.destructureError(new Error()); - stepDesc.location = { - fileName: jsError.frames[1].fileName, - lineNumber: jsError.frames[1].lineNumber, - columnNumber: jsError.frames[1].columnNumber, - }; + stepDesc.location = core.currentUserCallSite(); stepDesc.level = level + 1; stepDesc.parent = desc; stepDesc.rootId = rootId; |