diff options
Diffstat (limited to 'cli/tests/unit/buffer_test.ts')
-rw-r--r-- | cli/tests/unit/buffer_test.ts | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/cli/tests/unit/buffer_test.ts b/cli/tests/unit/buffer_test.ts index c5a63b5c8..644f05952 100644 --- a/cli/tests/unit/buffer_test.ts +++ b/cli/tests/unit/buffer_test.ts @@ -6,7 +6,6 @@ import { assertEquals, assert, - assertStringContains, assertThrows, assertThrowsAsync, unitTest, @@ -159,15 +158,13 @@ unitTest(async function bufferTooLargeByteWrites(): Promise<void> { const buf = new Deno.Buffer(xBytes.buffer as ArrayBuffer); await buf.read(tmp); - let err; - try { - buf.grow(growLen); - } catch (e) { - err = e; - } - - assert(err instanceof Error); - assertStringContains(err.message, "grown beyond the maximum size"); + assertThrows( + () => { + buf.grow(growLen); + }, + Error, + "grown beyond the maximum size" + ); }); unitTest(async function bufferLargeByteReads(): Promise<void> { |