Files
gridpilot.gg/adapters/identity/services/InMemoryPasswordHashingService.test.ts
2025-12-23 20:43:57 +01:00

15 lines
524 B
TypeScript

import { describe, expect, it } from 'vitest';
import { InMemoryPasswordHashingService } from './InMemoryPasswordHashingService';
describe('InMemoryPasswordHashingService', () => {
it('hashes and verifies deterministically', async () => {
const service = new InMemoryPasswordHashingService();
const hash = await service.hash('secret');
expect(hash).toBe('demo_salt_terces');
expect(await service.verify('secret', hash)).toBe(true);
expect(await service.verify('wrong', hash)).toBe(false);
});
});