From a065604155991dbf4417b606d4562d275cd8955f Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 28 Oct 2021 08:43:40 +1100 Subject: feat(cli): enable `useUnknownInCatchVariables` by default (#12547) Closes #11826 **BREAKING CHANGE** this behaviour was disable when introduced in Deno 1.14/TypeScript 4.4. It will highlight code that unsafely handles variables that are caught, and will cause type errors in unsafe code. --- cli/tests/unit/write_file_test.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cli/tests/unit/write_file_test.ts') diff --git a/cli/tests/unit/write_file_test.ts b/cli/tests/unit/write_file_test.ts index 0f99e2749..9ad8da578 100644 --- a/cli/tests/unit/write_file_test.ts +++ b/cli/tests/unit/write_file_test.ts @@ -1,5 +1,6 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. import { + assert, assertEquals, assertRejects, assertThrows, @@ -251,6 +252,7 @@ unitTest( try { await Deno.writeFile(filename, data, { signal: ac.signal }); } catch (e) { + assert(e instanceof Error); assertEquals(e.name, "AbortError"); } const stat = Deno.statSync(filename); @@ -269,6 +271,7 @@ unitTest( try { await Deno.writeFile(filename, data, { signal: ac.signal }); } catch (e) { + assert(e instanceof Error); assertEquals(e.name, "AbortError"); } const stat = Deno.statSync(filename); -- cgit v1.2.3