0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-04 01:44:26 -05:00
deno/cli/tests/unit/dispatch_bin_test.ts

35 lines
723 B
TypeScript
Raw Normal View History

import {
assert,
assertEquals,
assertMatch,
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> {
const buf = new Uint8Array(10);
const rid = 10;
try {
await Deno.read(rid, buf);
unreachable();
} catch (error) {
assertMatch(error.stack, readErrorStackPattern);
}
});
declare global {
// deno-lint-ignore no-namespace
namespace Deno {
// deno-lint-ignore no-explicit-any
var core: any; // eslint-disable-line no-var
}
}