fixes
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
/* eslint-disable no-magic-numbers */
|
||||
// @ts-nocheck
|
||||
'use strict';
|
||||
|
||||
const test = require ('ava');
|
||||
@ -19,3 +21,18 @@ test ('fail decryption', (t) => {
|
||||
const dec = crypto.decrypt_aes (enc, 'baz');
|
||||
t.is (dec, null);
|
||||
});
|
||||
|
||||
test ('unique crypto strings', (t) => {
|
||||
const enc = [
|
||||
crypto.encrypt_aes ('foo', 'bar'),
|
||||
crypto.encrypt_aes ('foo', 'bar'),
|
||||
crypto.encrypt_aes ('foo', 'bar'),
|
||||
crypto.encrypt_aes ('foo', 'bar'),
|
||||
crypto.encrypt_aes ('foo', 'bar'),
|
||||
crypto.encrypt_aes ('foo', 'bar'),
|
||||
crypto.encrypt_aes ('foo', 'bar'),
|
||||
crypto.encrypt_aes ('foo', 'bar')
|
||||
];
|
||||
const unique = enc.filter ((v, i) => enc.indexOf (v) === i).length;
|
||||
t.is (unique, 8);
|
||||
});
|
||||
|
Reference in New Issue
Block a user