


























1+import { spawnSync } from "node:child_process";
2+import { describe, expect, it } from "vitest";
3+4+const SCRIPT = "scripts/android-screenshots.sh";
5+6+function runAndroidScreenshots(args: string[]) {
7+return spawnSync("bash", [SCRIPT, ...args], {
8+encoding: "utf8",
9+});
10+}
11+12+describe("android screenshots script", () => {
13+it("dry-runs with a normalized locale output path", () => {
14+const result = runAndroidScreenshots(["--dry-run", "--locale", "pt-BR"]);
15+16+expect(result.status).toBe(0);
17+expect(result.stdout).toContain(
18+"apps/android/fastlane/metadata/android/pt-BR/images/phoneScreenshots",
19+);
20+expect(result.stdout).toContain("Dry run complete.");
21+});
22+23+it.each(["../escape", "en/US", ".hidden", "en..US", ""])(
24+"rejects locale path escapes before dry-run output: %j",
25+(locale) => {
26+const result = runAndroidScreenshots(["--dry-run", "--locale", locale]);
27+28+expect(result.status).not.toBe(0);
29+expect(result.stderr).toContain("Invalid Android screenshot locale");
30+expect(result.stderr).toContain("path separators and dot segments are not allowed");
31+expect(result.stdout).not.toContain("Android screenshot output:");
32+},
33+);
34+});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。