diff options
| author | Christopher Warner <cwarner@kernelcode.com> | 2026-10-10 18:28:43 -0400 |
|---|---|---|
| committer | Christopher Warner <cwarner@kernelcode.com> | 2026-10-10 18:28:43 -0400 |
| commit | ef0165cc6cbe001997e5d05af5de6d4849481d7a (patch) | |
| tree | 98b10c875c012a6b18160f8897f444aceff60790 /tests/cli.test.sh | |
| download | iphone-notes-ef0165cc6cbe001997e5d05af5de6d4849481d7a.tar.gz iphone-notes-ef0165cc6cbe001997e5d05af5de6d4849481d7a.tar.bz2 iphone-notes-ef0165cc6cbe001997e5d05af5de6d4849481d7a.tar.xz iphone-notes-ef0165cc6cbe001997e5d05af5de6d4849481d7a.zip | |
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 <cursoragent@cursor.com>
Diffstat (limited to 'tests/cli.test.sh')
| -rwxr-xr-x | tests/cli.test.sh | 31 |
1 files changed, 31 insertions, 0 deletions
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." |
