From be8bacaaa4258089e5a0cf4f1d8f53db8e534d4b Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Wed, 10 Jun 2020 23:54:54 +0800 Subject: fix: Remove try-catch from Buffer.readFrom, readFromSync (#6161) --- cli/tests/unit/buffer_test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cli/tests/unit/buffer_test.ts') diff --git a/cli/tests/unit/buffer_test.ts b/cli/tests/unit/buffer_test.ts index a5a0147ab..23e655a05 100644 --- a/cli/tests/unit/buffer_test.ts +++ b/cli/tests/unit/buffer_test.ts @@ -7,6 +7,8 @@ import { assertEquals, assert, assertStringContains, + assertThrows, + assertThrowsAsync, unitTest, } from "./test_util.ts"; @@ -202,6 +204,9 @@ unitTest(async function bufferReadFrom(): Promise { const fub = new Uint8Array(testString.length); await empty(b, s, fub); } + assertThrowsAsync(async function () { + await new Buffer().readFrom(null!); + }); }); unitTest(async function bufferReadFromSync(): Promise { @@ -221,6 +226,9 @@ unitTest(async function bufferReadFromSync(): Promise { const fub = new Uint8Array(testString.length); await empty(b, s, fub); } + assertThrows(function () { + new Buffer().readFromSync(null!); + }); }); unitTest(async function bufferTestGrow(): Promise { -- cgit v1.2.3