(t, method, claim, value, expected = value)
| 47 | }) |
| 48 | |
| 49 | async function testJWTsetFunction(t, method, claim, value, expected = value) { |
| 50 | const jwt = new UnsecuredJWT()[method](value).encode() |
| 51 | const claims = decodeJwt(jwt) |
| 52 | t.true(claim in claims) |
| 53 | t.is(claims[claim], expected) |
| 54 | } |
| 55 | testJWTsetFunction.title = (title, method, claim, value) => |
| 56 | `UnsecuredJWT.prototype.${method} called with ${ |
| 57 | value?.constructor?.name || typeof value |