diff options
Diffstat (limited to 'runtime/js/40_testing.js')
-rw-r--r-- | runtime/js/40_testing.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js index b176e7b2d..47af45110 100644 --- a/runtime/js/40_testing.js +++ b/runtime/js/40_testing.js @@ -635,6 +635,16 @@ ); } + const jsError = Deno.core.destructureError(new Error()); + // Note: There might pop up a case where one of the filename, line number or + // column number from the caller isn't defined. We assume never for now. + // Make `TestDescription::location` optional if such a case is found. + testDef.location = { + fileName: jsError.frames[1].fileName, + lineNumber: jsError.frames[1].lineNumber, + columnNumber: jsError.frames[1].columnNumber, + }; + ArrayPrototypePush(tests, testDef); } @@ -1097,6 +1107,7 @@ const description = { origin, name: test.name, + location: test.location, }; const earlier = DateNow(); |