From ef0165cc6cbe001997e5d05af5de6d4849481d7a Mon Sep 17 00:00:00 2001 From: Christopher Warner Date: Sat, 10 Oct 2026 18:28:43 -0400 Subject: feat: add icloud.com/notes helper and agent skill Send real Apple Notes from Linux via a Playwright session so agents can forward results to an iPhone without LocalSend. Co-authored-by: Cursor --- tests/cli.test.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 tests/cli.test.sh (limited to 'tests') diff --git a/tests/cli.test.sh b/tests/cli.test.sh new file mode 100755 index 0000000..2694938 --- /dev/null +++ b/tests/cli.test.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Smoke tests for icloud-note CLI (no Apple login / network create required). +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +CLI=(node "$ROOT/scripts/icloud-note.mjs") + +fail() { echo "FAIL: $*" >&2; exit 1; } +pass() { echo "ok: $*"; } + +out="$("${CLI[@]}" help 2>&1)" || fail "help exited non-zero" +[[ "$out" == *"icloud-note create"* ]] || fail "help missing create usage" +pass "help" + +set +e +err="$("${CLI[@]}" nosuchcmd 2>&1)" +code=$? +set -e +[[ "$code" -ne 0 ]] || fail "unknown command should fail" +[[ "$err" == *"Unknown command"* ]] || fail "unknown command message" +pass "unknown command" + +set +e +err="$("${CLI[@]}" create 2>&1)" +code=$? +set -e +[[ "$code" -ne 0 ]] || fail "create without content should fail" +[[ "$err" == *"Provide --title"* ]] || fail "create empty message" +pass "create requires content" + +echo "All cli tests passed." -- cgit v1.2.3