You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/keyvault.test.ts
+24-9Lines changed: 24 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,15 @@ describe("key vault reference", function () {
40
40
});
41
41
42
42
it("require key vault options to resolve reference",async()=>{
43
-
returnexpect(load(createMockedConnectionString())).eventually.rejectedWith("Failed to process the Key Vault reference because Key Vault options are not configured.");
43
+
try{
44
+
awaitload(createMockedConnectionString());
45
+
}catch(error){
46
+
expect(error.message).eq("Failed to load.");
47
+
expect(error.cause.message).eq("Failed to process the Key Vault reference because Key Vault options are not configured.");
48
+
return;
49
+
}
50
+
// we should never reach here, load should throw an error
51
+
thrownewError("Expected load to throw.");
44
52
});
45
53
46
54
it("should resolve key vault reference with credential",async()=>{
@@ -89,14 +97,21 @@ describe("key vault reference", function () {
89
97
});
90
98
91
99
it("should throw error when secret clients not provided for all key vault references",async()=>{
returnexpect(loadKeyVaultPromise).eventually.rejectedWith("Failed to process the key vault reference. No key vault secret client, credential or secret resolver callback is available to resolve the secret.");
expect(error.cause.message).eq("Failed to process the key vault reference. No key vault secret client, credential or secret resolver callback is available to resolve the secret.");
111
+
return;
112
+
}
113
+
// we should never reach here, load should throw an error
114
+
thrownewError("Expected load to throw.");
100
115
});
101
116
102
117
it("should fallback to use default credential when corresponding secret client not provided",async()=>{
0 commit comments