diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2022-05-18 22:00:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-18 22:00:11 +0200 |
commit | 4e1ca1d1787f25ab9f0a72ccf9d8028f70b3a7ed (patch) | |
tree | 2d0062ec1dd864c7ed98301119ac5f1c133f844a /cli/tests/unit/test_util.ts | |
parent | 5ad8919d642b646caa3328930dd1a3f290bc587e (diff) |
refactor: use spawn API across codebase (#14414)
Diffstat (limited to 'cli/tests/unit/test_util.ts')
-rw-r--r-- | cli/tests/unit/test_util.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/cli/tests/unit/test_util.ts b/cli/tests/unit/test_util.ts index 36ef8c0e7..18965fdab 100644 --- a/cli/tests/unit/test_util.ts +++ b/cli/tests/unit/test_util.ts @@ -31,17 +31,13 @@ export function pathToAbsoluteFileUrl(path: string): URL { const decoder = new TextDecoder(); export async function execCode(code: string): Promise<[number, string]> { - const p = Deno.run({ - cmd: [ - Deno.execPath(), + const { status, stdout } = await Deno.spawn(Deno.execPath(), { + args: [ "eval", "--unstable", "--no-check", code, ], - stdout: "piped", }); - const [status, output] = await Promise.all([p.status(), p.output()]); - p.close(); - return [status.code, decoder.decode(output)]; + return [status.code, decoder.decode(stdout)]; } |