From c86ee742a2522a169bfe40890b946c646aeac1cf Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 9 Apr 2021 16:55:33 +0100 Subject: fix: async op error stacktraces (#10080) Co-authored-by: Aaron O'Mullan --- cli/tests/unit/dispatch_bin_test.ts | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'cli/tests') diff --git a/cli/tests/unit/dispatch_bin_test.ts b/cli/tests/unit/dispatch_bin_test.ts index ca1864621..54a379bc0 100644 --- a/cli/tests/unit/dispatch_bin_test.ts +++ b/cli/tests/unit/dispatch_bin_test.ts @@ -1,27 +1,16 @@ -import { - assert, - assertEquals, - assertMatch, - unitTest, - unreachable, -} from "./test_util.ts"; +import { assertStringIncludes, unitTest, unreachable } from "./test_util.ts"; -const readErrorStackPattern = new RegExp( - `^.* - at processErr \\(.*core\\.js:.*\\) - at opAsyncHandler \\(.*core\\.js:.*\\) - at handleAsyncMsgFromRust \\(.*core\\.js:.*\\).*$`, - "ms", -); - -unitTest(async function sendAsyncStackTrace(): Promise { +unitTest(async function sendAsyncStackTrace() { const buf = new Uint8Array(10); const rid = 10; try { await Deno.read(rid, buf); unreachable(); } catch (error) { - assertMatch(error.stack, readErrorStackPattern); + const s = error.stack.toString(); + console.log(s); + assertStringIncludes(s, "dispatch_bin_test.ts"); + assertStringIncludes(s, "read"); } }); -- cgit v1.2.3