MCPcopy
hub / github.com/panva/jose / testJWTsetFunction

Function testJWTsetFunction

test/jwt/unsecured.test.ts:49–54  ·  view source on GitHub ↗
(t, method, claim, value, expected = value)

Source from the content-addressed store, hash-verified

47})
48
49async 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}
55testJWTsetFunction.title = (title, method, claim, value) =>
56 `UnsecuredJWT.prototype.${method} called with ${
57 value?.constructor?.name || typeof value

Callers

nothing calls this directly

Calls 2

decodeJwtFunction · 0.85
encodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…