Scope
Port Bun corpus position 4004, js/third_party/jsonwebtoken/claim-aud.test.js.
Acceptance criteria
- The copied jsonwebtoken
test-utilshelper resolves and checks sync/async parity. - Signing validates
audience, rejects conflicting payload claims and invalid payload forms, and emitsaudcorrectly. - Verification accepts matching strings, regexes, and arrays against string/array payload audiences.
- Mismatches return
JsonWebTokenErrorwith the upstream message in sync and callback forms. - Verification failures retain operation/claim context, original causes, and readable stacks.
- Focused, neighboring JWT, and permanent diagnostics pass.