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.
This commit is contained in:
Bartek Iwańczuk 2022-12-02 14:43:17 +01:00 committed by GitHub
parent 6982c74e11
commit 4d07ed0efa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 104 additions and 104 deletions

View file

@ -1046,9 +1046,9 @@ function createHttpsListener(port: number): Deno.Listener {
}
async function curl(url: string): Promise<string> {
const { success, code, stdout } = await Deno.spawn("curl", {
const { success, code, stdout } = await new Deno.Command("curl", {
args: ["--insecure", url],
});
}).output();
if (!success) {
throw new Error(`curl ${url} failed: ${code}`);