All files / test testUtils.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 51x 8x 8x 8x  
export function generateMockjwt(expiryInSecsFromNow : number): string {
    const header = Buffer.from(JSON.stringify({alg: 'HS256', typ: 'JWT'})).toString('base64url');
    const payload = Buffer.from(JSON.stringify({exp: Math.floor(Date.now()/1000) + expiryInSecsFromNow})).toString('base64url');
    return `${header}.${payload}.signature`;
}