* refactor: use fastify vite for the server by doing this we do not need to have local hacks for the routes. No local proxy needed. Everything just works. * fix: update the dockerfile build path * fix: update package.json * fix: fonts path
19 lines
521 B
JavaScript
19 lines
521 B
JavaScript
import assert from 'assert';
|
|
|
|
import { decrypt, encrypt, generateKey } from '../../../shared/helpers/crypto.js';
|
|
|
|
const SECRET = 'MASTER_KEY=1337-super-secret';
|
|
|
|
const RANDOM_KEY = generateKey();
|
|
|
|
describe('Crypto', () => {
|
|
describe('#encrypt(string)', () => {
|
|
it('should encrypt, and decrypt a secret', async () => {
|
|
const encrypted = encrypt(SECRET, RANDOM_KEY);
|
|
const decrypted = decrypt(encrypted, RANDOM_KEY);
|
|
|
|
assert.equal(decrypted, SECRET);
|
|
});
|
|
});
|
|
});
|