From 4d07ed0efa8f0e2cab1a33f1b7b6a3627bfce69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 2 Dec 2022 14:43:17 +0100 Subject: chore: rewrite tests and utils to use Deno.Command API (#16895) Since "Deno.spawn()", "Deno.spawnSync()" and "Deno.spawnChild" are getting deprecated, this commits rewrites all tests and utilities to use "Deno.Command" API instead. --- cli/tests/unit/test_util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/tests/unit/test_util.ts') diff --git a/cli/tests/unit/test_util.ts b/cli/tests/unit/test_util.ts index c33da5338..9a1b13038 100644 --- a/cli/tests/unit/test_util.ts +++ b/cli/tests/unit/test_util.ts @@ -32,13 +32,13 @@ export function pathToAbsoluteFileUrl(path: string): URL { const decoder = new TextDecoder(); export async function execCode(code: string): Promise<[number, string]> { - const output = await Deno.spawn(Deno.execPath(), { + const output = await new Deno.Command(Deno.execPath(), { args: [ "eval", "--unstable", "--no-check", code, ], - }); + }).output(); return [output.code, decoder.decode(output.stdout)]; } -- cgit v1.2.3