diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-04-09 16:55:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-09 11:55:33 -0400 |
commit | c86ee742a2522a169bfe40890b946c646aeac1cf (patch) | |
tree | 73b6f1efb0a72ab9f8186d76595186b133b4b554 /cli/tests/unit/dispatch_bin_test.ts | |
parent | c6e7a243d524417fe77c4799a2bcc1b3db1bf01a (diff) |
fix: async op error stacktraces (#10080)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'cli/tests/unit/dispatch_bin_test.ts')
-rw-r--r-- | cli/tests/unit/dispatch_bin_test.ts | 23 |
1 files changed, 6 insertions, 17 deletions
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<void> { +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"); } }); |