@@ -66,21 +66,21 @@ describe("Local cryptography public tests", () => {
6666 const expectedErrorMessage = "Algorithm foo is not supported for a local JsonWebKey." ;
6767
6868 it ( "throws on encrypt" , async function ( ) {
69- assert . isRejected (
69+ await assert . isRejected (
7070 cryptoClientFromKey . encrypt ( "foo" , Buffer . from ( "bar" ) ) ,
7171 expectedErrorMessage
7272 ) ;
7373 } ) ;
7474
7575 it ( "throws on wrapKey" , async function ( ) {
76- assert . isRejected (
76+ await assert . isRejected (
7777 cryptoClientFromKey . wrapKey ( "A128KW" , Buffer . from ( "bar" ) ) ,
7878 "Algorithm A128KW is not supported for a local JsonWebKey."
7979 ) ;
8080 } ) ;
8181
8282 it ( "throws on verifyData" , async function ( ) {
83- assert . isRejected (
83+ await assert . isRejected (
8484 cryptoClientFromKey . verifyData ( "foo" , Buffer . from ( "bar" ) , Buffer . from ( "baz" ) ) ,
8585 expectedErrorMessage
8686 ) ;
@@ -89,37 +89,37 @@ describe("Local cryptography public tests", () => {
8989
9090 describe ( "when using an unsupported operation" , function ( ) {
9191 it ( "throws on decrypt" , async function ( ) {
92- assert . isRejected (
92+ await assert . isRejected (
9393 cryptoClientFromKey . decrypt ( "RSA1_5" , Buffer . from ( "bar" ) ) ,
94- "Decrypting a local JsonWebKey is not supported."
94+ "Decrypting using a local JsonWebKey is not supported."
9595 ) ;
9696 } ) ;
9797
9898 it ( "throws on unwrapKey" , async function ( ) {
99- assert . isRejected (
99+ await assert . isRejected (
100100 cryptoClientFromKey . unwrapKey ( "RSA1_5" , Buffer . from ( "bar" ) ) ,
101- "Unwrapping a local JsonWebKey is not supported."
101+ "Unwrapping a key using a local JsonWebKey is not supported."
102102 ) ;
103103 } ) ;
104104
105105 it ( "throws on sign" , async function ( ) {
106- assert . isRejected (
106+ await assert . isRejected (
107107 cryptoClientFromKey . sign ( "RSA1_5" , Buffer . from ( "bar" ) ) ,
108- "Signing a local JsonWebKey is not supported."
108+ "Signing a digest using a local JsonWebKey is not supported."
109109 ) ;
110110 } ) ;
111111
112112 it ( "throws on verify" , async function ( ) {
113- assert . isRejected (
113+ await assert . isRejected (
114114 cryptoClientFromKey . verify ( "RSA1_5" , Buffer . from ( "bar" ) , Buffer . from ( "baz" ) ) ,
115- "Verifying a local JsonWebKey is not supported."
115+ "Verifying a digest using a local JsonWebKey is not supported."
116116 ) ;
117117 } ) ;
118118
119119 it ( "throws on signData" , async function ( ) {
120- assert . isRejected (
120+ await assert . isRejected (
121121 cryptoClientFromKey . signData ( "RSA1_5" , Buffer . from ( "bar" ) ) ,
122- "Signing a local JsonWebKey is not supported."
122+ "Signing data using a local JsonWebKey is not supported."
123123 ) ;
124124 } ) ;
125125 } ) ;
0 commit comments