mirror of
https://github.com/expo/explore.git
synced 2026-11-14 10:08:17 -10:00
Co-authored-by: Brent Vatne <[email protected]> Co-authored-by: Szymon Dziedzic <[email protected]>
20 lines
849 B
JavaScript
20 lines
849 B
JavaScript
import assert from "node:assert/strict";
|
|
import { join, resolve } from "node:path";
|
|
import { spawnSync } from "node:child_process";
|
|
import test from "node:test";
|
|
|
|
const root = resolve(import.meta.dirname, "../..");
|
|
const cli = join(root, "dist", "cli.js");
|
|
|
|
function runCli(args) {
|
|
return spawnSync(process.execPath, [cli, ...args, "--json"], { encoding: "utf8" });
|
|
}
|
|
|
|
test("ci:report rejects obsolete catalog publication flags with an actionable failure", () => {
|
|
const result = runCli(["ci:report", "--catalog", "old-build-catalog.json", "--output", "report"]);
|
|
assert.notEqual(result.status, 0);
|
|
assert.match(result.stderr, /Unknown flag for ci:report: --catalog/);
|
|
assert.equal(JSON.parse(result.stderr).diagnostic.code, "CLI_ARGUMENT_INVALID");
|
|
assert.match(JSON.parse(result.stderr).diagnostic.nextAction, /Remove --catalog/);
|
|
});
|