Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
✅ Add tests for pwned service
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 8, 2020
1 parent 2543b93 commit 4a5445f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/modules/pwned/pwned.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { PwnedService } from './pwned.service';

const pwnedService = new PwnedService();

describe('PwnedService', () => {
describe('isPasswordSafe', () => {
it('unsafe password', async () => {
const safe = await pwnedService.isPasswordSafe('password123');
expect(safe).toBeFalsy();
});
it('safe password', async () => {
const safe = await pwnedService.isPasswordSafe(
Math.random().toString(36).slice(2),
);
expect(safe).toBeTruthy();
});
});
});

0 comments on commit 4a5445f

Please sign in to comment.