Skip to content

Commit

Permalink
fix: resolve provider chain when no credentials found
Browse files Browse the repository at this point in the history
  • Loading branch information
yndu13 committed May 27, 2024
1 parent 00d4b6c commit 3a7e7be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/provider/provider_chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export function getCredentials(providers: IProvider[] = null): ICredential {
}
}

return null;
throw new Error('Not found credentials');
}
7 changes: 4 additions & 3 deletions test/provider_chain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ describe('ProviderChain', function () {
});

describe('ProviderChain', function () {
it('should return null', async function () {
let cred = ProviderChain.getCredentials();
assert.deepStrictEqual(cred, null);
it('should return error', async function () {
expect(function () {
ProviderChain.getCredentials();
}).throwException(/Not found credentials/);
});
});

0 comments on commit 3a7e7be

Please sign in to comment.