Files
plugins/packages/cloudflare-workers-ai/test
Guislabert 1ae89aa7b6 cloudflare-workers-ai 0.0.2: usage() checks the Account ID, one (Paid) rule, parser tests (#327)
Follow-up to #326 (Guislabert). usage() applies loader()'s 32-hex Account ID check, so an invalid id returns the fallback plan row and never reaches the /accounts/{id} path. The "(Paid)" name rule lives in one paidName helper. Two parser tests cover a non-HTTP(S) baseTemplate and an unknown placeholder. Version 0.0.2.

Run at the reviewed head afd7878 (based on origin/main):
- bun scripts/check.mjs cloudflare-workers-ai: ok
- node --test in the package under a temp HOME: 15 of 15 pass
- main's src/index.mjs with the new tests: the invalid-Account-ID usage test fails (14 of 15), so it guards the fix
- afd7878 against 114900a: README CHANGELOG links dropped, version 0.0.2; src and tests unchanged

Not tried here: a real Cloudflare account (the author's run on 0.0.1 is on #326).
2026-10-23 07:51:49 +08:00
..