Files
jose/test/jwe/compact.decrypt.test.ts
Filip Skokan eebee55a01 refactor: restructure src/lib and src/runtime now that runtime is fixed
BREAKING CHANGE: createRemoteJWKSet now uses fetch, because of that its Node.js only options.agent property has been removed and new fetch-related options were added
2025-02-22 15:16:04 +01:00

15 lines
419 B
TypeScript

import test from 'ava'
import { compactDecrypt } from '../../src/index.js'
test('JWE format validation', async (t) => {
await t.throwsAsync(compactDecrypt(null, new Uint8Array(0)), {
message: 'Compact JWE must be a string or Uint8Array',
code: 'ERR_JWE_INVALID',
})
await t.throwsAsync(compactDecrypt('...', new Uint8Array(0)), {
message: 'Invalid Compact JWE',
code: 'ERR_JWE_INVALID',
})
})