@@ -5,6 +5,23 @@ import { describe, expect, it } from "vitest";
|
5 | 5 | |
6 | 6 | const SCRIPT = path.join(process.cwd(), "scripts", "ios-release-signing.mjs"); |
7 | 7 | |
| 8 | +function runSigningResult(args: string[]): { ok: boolean; stdout: string; stderr: string } { |
| 9 | +try { |
| 10 | +const stdout = execFileSync(process.execPath, [SCRIPT, ...args], { |
| 11 | +encoding: "utf8", |
| 12 | +stdio: ["ignore", "pipe", "pipe"], |
| 13 | +}); |
| 14 | +return { ok: true, stdout, stderr: "" }; |
| 15 | +} catch (error) { |
| 16 | +const e = error as { stdout?: unknown; stderr?: unknown }; |
| 17 | +return { |
| 18 | +ok: false, |
| 19 | +stdout: Buffer.isBuffer(e.stdout) ? e.stdout.toString("utf8") : String(e.stdout ?? ""), |
| 20 | +stderr: Buffer.isBuffer(e.stderr) ? e.stderr.toString("utf8") : String(e.stderr ?? ""), |
| 21 | +}; |
| 22 | +} |
| 23 | +} |
| 24 | + |
8 | 25 | function runSigning(mode: string): string { |
9 | 26 | return execFileSync(process.execPath, [SCRIPT, "--mode", mode], { |
10 | 27 | encoding: "utf8", |
@@ -13,6 +30,19 @@ function runSigning(mode: string): string {
|
13 | 30 | } |
14 | 31 | |
15 | 32 | describe("scripts/ios-release-signing.mjs", () => { |
| 33 | +it.each([ |
| 34 | +["--mode"], |
| 35 | +["--mode", "--manifest"], |
| 36 | +["--manifest"], |
| 37 | +])("rejects missing values for %s before reading signing manifests", (...args) => { |
| 38 | +const result = runSigningResult(args); |
| 39 | + |
| 40 | +expect(result.ok).toBe(false); |
| 41 | +expect(result.stderr).toContain(`Missing value for ${args[0]}.`); |
| 42 | +expect(result.stderr).not.toContain("ENOENT"); |
| 43 | +expect(result.stdout).toBe(""); |
| 44 | +}); |
| 45 | + |
16 | 46 | it("emits manual App Store profile settings for every signed target", () => { |
17 | 47 | const output = runSigning("xcconfig"); |
18 | 48 | |
|