import { PlainPasswordHasher } from '../PlainPasswordHasher' const passwords = ['', 'a', 'abc', 'test'] it('hashes and verifies passwords', async () => { const hasher = new PlainPasswordHasher() await Promise.all( passwords.map(async password => expect(await hasher.verify(password, await hasher.hash(password))).toBe(true)) ) await Promise.all( passwords.map(async password => expect(await hasher.verify(password + '!', await hasher.hash(password))).toBe(false) ) ) })