We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af041f7 commit f7e0ed9Copy full SHA for f7e0ed9
src/infra/criptography/bcrypt-adapter.spec.ts
@@ -0,0 +1,11 @@
1
+import { BcryptAdapter } from './bcrypt-adapter'
2
+import bcrypt from 'bcrypt'
3
+describe('Bcrypt Adapter', () => {
4
+ test('Should call bcrypt with correct values', async () => {
5
+ const salt = 12
6
+ const sut = new BcryptAdapter(salt)
7
+ const hashSpy = jest.spyOn(bcrypt, 'hash')
8
+ await sut.encrypt('any_value')
9
+ expect(hashSpy).toHaveBeenCalledWith('any_value', salt)
10
+ })
11
+})
0 commit comments