From 9cc7e32e37e6708980abc051f2cb71526c175d88 Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Wed, 24 Feb 2021 20:55:50 +0800 Subject: feat: add exit sanitizer to Deno.test (#9529) This adds an exit sanitizer to ensure that code being tested or dependencies of that code can't accidentally call "Deno.exit" leading to partial test runs and false results. --- cli/dts/lib.deno.ns.d.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cli/dts') diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 04bf8ad80..1627843e4 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -108,6 +108,10 @@ declare namespace Deno { * after the test has exactly the same contents as before the test. Defaults * to true. */ sanitizeResources?: boolean; + + /** Ensure the test case does not prematurely cause the process to exit, + * for example via a call to `Deno.exit`. Defaults to true. */ + sanitizeExit?: boolean; } /** Register a test which will be run when `deno test` is used on the command -- cgit v1.2.3