Write a better error message when key not found

This commit is contained in:
Simon Johansson 2021-01-27 16:22:26 +01:00
parent 5e5c06a3c8
commit 7dc1ddf98c
No known key found for this signature in database
GPG key ID: 63F236A41D9A79AC
2 changed files with 19 additions and 3 deletions

View file

@ -123,6 +123,14 @@ describe('integration', () => {
.mockReturnValueOnce(secrets);
}
it('prints a nice error message when secret not found', async () => {
mockInput(`secret/data/test secret ;
secret/data/test secret | NAMED_SECRET ;
secret/data/notFound kehe | NO_SIR ;`);
expect(exportSecrets()).rejects.toEqual(Error(`Unable to retrieve result for "secret/data/notFound". Double check your Key.`));
})
it('get simple secret', async () => {
mockInput('secret/data/test secret');