feat: first version
Some checks failed
Build, check & Test / run (push) Failing after 39s

Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
This commit is contained in:
2023-07-20 17:41:16 +02:00
parent 2bd59f902f
commit 09ed4c487d
80 changed files with 1171 additions and 2755 deletions

View File

@ -1,5 +1,4 @@
import { assert, expect, test } from 'vitest'
import { comparePassword, hashPassword } from '../src/libs/AuthUtils'
import { expect, test } from 'vitest'
// Edit an assertion and save to see HMR in action
@ -8,26 +7,3 @@ test('Math.sqrt()', () => {
expect(Math.sqrt(144)).toBe(12);
expect(Math.sqrt(2)).toBe(Math.SQRT2);
});
test('JSON', () => {
const input = {
foo: 'hello',
bar: 'world',
};
const output = JSON.stringify(input);
expect(output).eq('{"foo":"hello","bar":"world"}');
assert.deepEqual(JSON.parse(output), input, 'matches original');
});
test('auth util', async () => {
const password = 'pouet'
const out1 = await hashPassword(password)
expect(out1).not.toBe(password)
const out2 = await hashPassword(password)
expect(out2).not.toBe(out1)
expect(await comparePassword(password, out1)).toBe(true)
expect(await comparePassword(password, out2)).toBe(true)
})