mirror of
https://github.com/danbulant/jose
synced 2026-05-25 04:51:47 +00:00
12 lines
438 B
JavaScript
12 lines
438 B
JavaScript
import test from 'ava'
|
|
|
|
const root = !('WEBCRYPTO' in process.env) ? '#dist' : '#dist/webcrypto'
|
|
const { default: checkIvLength } = await import(`${root}/lib/check_iv_length`)
|
|
|
|
test('lib/check_iv_length.ts', (t) => {
|
|
t.throws(() => checkIvLength('A256GCM', new Uint8Array(13)), {
|
|
code: 'ERR_JWE_INVALID',
|
|
message: 'Invalid Initialization Vector length',
|
|
})
|
|
t.notThrows(() => checkIvLength('A256GCM', new Uint8Array(12)))
|
|
})
|