summaryrefslogtreecommitdiff
path: root/packages/integrations/netlify/test/test-utils.js
blob: 6da676180f37337f31b4b07b3b411c0f284c1512 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { execa } from "execa";

/** Returns a process running the Astro CLI. */
export function cli(/** @type {string[]} */ ...args) {
  const spawned = execa("npx", ["astro", ...args], {
    env: { ASTRO_TELEMETRY_DISABLED: true },
  });

  spawned.stdout.setEncoding("utf8");

  return spawned;
}