mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
cd9a7ce41b
* test(android): add catalog emulator smoke coverage * test(android): use stable snapshot diff mutation * test(android): assert actual back destination * test(android): separate keyboard and fill IMEs * fix(ci): keep Android timing report in one shell * refactor(test): simplify simulator e2e coverage * test(android): assert stable diff landmarks * fix(android): release snapshot helper gracefully * fix(android): fully release snapshot helper runtime * test(android): report coverage classifications * fix(android): stabilize accessibility root capture * fix(android): bound UiAutomation connection * ci: upload worktree daemon diagnostics * fix(android): cancel stalled wait captures * fix(android): bound helper fallback lifecycle * fix(android): harden emulator e2e lifecycle * fix: align e2e changes with kernel package * test(android): prove alert helper reuse directly * fix(android): cancel stalled settle captures * fix(android): separate helper retirement budgets
23 lines
858 B
TypeScript
23 lines
858 B
TypeScript
import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts';
|
|
|
|
export type AndroidContractCommand = (typeof PUBLIC_COMMANDS)[keyof typeof PUBLIC_COMMANDS];
|
|
|
|
export type AndroidContractEvidence = {
|
|
commands: readonly AndroidContractCommand[];
|
|
owner: string;
|
|
testName: string;
|
|
};
|
|
|
|
export function defineAndroidContractEvidence(
|
|
owner: string,
|
|
commands: readonly AndroidContractCommand[],
|
|
testName: string,
|
|
): AndroidContractEvidence {
|
|
if (commands.length === 0) throw new Error(`${owner} must declare at least one command`);
|
|
if (new Set(commands).size !== commands.length) {
|
|
throw new Error(`${owner} declares duplicate Android contract commands`);
|
|
}
|
|
if (testName.trim().length === 0) throw new Error(`${owner} must name its executable test`);
|
|
return Object.freeze({ commands: Object.freeze([...commands]), owner, testName });
|
|
}
|