More robust encrypt/decrypt test

pull/6544/head
Chocobozzz 2024-08-09 09:16:00 +02:00
parent da3420ac40
commit d47d95cb6f
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 4 additions and 6 deletions

View File

@ -20,14 +20,12 @@ describe('Encrypt/Descrypt', function () {
const encrypted = await encrypt(str, 'my_secret')
let error = false
let decrypted = ''
try {
await decrypt(encrypted, 'my_sicret')
} catch (err) {
error = true
}
decrypted = await decrypt(encrypted, 'my_sicret')
} catch { }
expect(error).to.be.true
expect(decrypted).to.not.equal(encrypted)
})
})