@@ -117,11 +117,9 @@ describe('decorateCryptographicMaterial', () => {
117
117
const test = decorateCryptographicMaterial ( { suite } as any )
118
118
test . zeroUnencryptedDataKey ( )
119
119
const dataKey = new Uint8Array ( suite . keyLengthBytes ) . fill ( 1 )
120
- const trace =
121
- // It is very hard to test this perfectly. However, this tests the spirit.
122
- expect ( ( ) =>
123
- test . setUnencryptedDataKey ( new Uint8Array ( dataKey ) , trace )
124
- ) . to . throw ( )
120
+
121
+ // It is very hard to test this perfectly. However, this tests the spirit.
122
+ expect ( ( ) => test . setUnencryptedDataKey ( new Uint8Array ( dataKey ) ) ) . to . throw ( )
125
123
} )
126
124
127
125
it ( 'Precondition: dataKey must be Binary Data' , ( ) => {
@@ -138,10 +136,10 @@ describe('decorateCryptographicMaterial', () => {
138
136
)
139
137
const test = decorateCryptographicMaterial ( { suite } as any )
140
138
const dataKey = new Uint8Array ( suite . keyLengthBytes ) . fill ( 1 )
141
- const trace = test . setUnencryptedDataKey ( new Uint8Array ( dataKey ) , trace )
142
- expect ( ( ) =>
143
- test . setUnencryptedDataKey ( new Uint8Array ( dataKey ) , trace )
144
- ) . to . throw ( 'unencryptedDataKey has already been set' )
139
+ test . setUnencryptedDataKey ( new Uint8Array ( dataKey ) )
140
+ expect ( ( ) => test . setUnencryptedDataKey ( new Uint8Array ( dataKey ) ) ) . to . throw (
141
+ 'unencryptedDataKey has already been set'
142
+ )
145
143
} )
146
144
147
145
it ( 'Precondition: dataKey should have an ArrayBuffer that *only* stores the key.' , ( ) => {
@@ -154,9 +152,9 @@ describe('decorateCryptographicMaterial', () => {
154
152
5 ,
155
153
suite . keyLengthBytes
156
154
) . fill ( 1 )
157
- const trace = expect ( ( ) =>
158
- test . setUnencryptedDataKey ( dataKey , trace )
159
- ) . to . throw ( 'Unencrypted Master Key must be an isolated buffer.' )
155
+ expect ( ( ) => test . setUnencryptedDataKey ( dataKey ) ) . to . throw (
156
+ 'Unencrypted Master Key must be an isolated buffer.'
157
+ )
160
158
} )
161
159
162
160
it ( 'Precondition: The unencryptedDataKey must not have been modified.' , ( ) => {
@@ -374,7 +372,7 @@ describe('decorateWebCryptoMaterial', () => {
374
372
usages : [ 'deriveKey' ] ,
375
373
extractable : false ,
376
374
}
377
- const trace = test . setCryptoKey ( key , trace )
375
+ test . setCryptoKey ( key )
378
376
expect ( test . getCryptoKey ( ) === key ) . to . equal ( true )
379
377
expect ( test . hasCryptoKey ) . to . equal ( true )
380
378
expect ( test . hasUnencryptedDataKey ) . to . equal ( false )
@@ -395,7 +393,7 @@ describe('decorateWebCryptoMaterial', () => {
395
393
extractable : false ,
396
394
}
397
395
const mixedKey : any = { zeroByteCryptoKey : key , nonZeroByteCryptoKey : key }
398
- const trace = test . setCryptoKey ( mixedKey , trace )
396
+ test . setCryptoKey ( mixedKey )
399
397
expect ( test . getCryptoKey ( ) !== mixedKey ) . to . equal ( true )
400
398
expect ( test . hasCryptoKey ) . to . equal ( true )
401
399
expect ( test . hasUnencryptedDataKey ) . to . equal ( false )
@@ -427,8 +425,8 @@ describe('decorateWebCryptoMaterial', () => {
427
425
usages : [ 'deriveKey' ] ,
428
426
extractable : false ,
429
427
}
430
- const trace = test . setCryptoKey ( key , trace )
431
- expect ( ( ) => test . setCryptoKey ( key , trace ) ) . to . throw ( )
428
+ test . setCryptoKey ( key )
429
+ expect ( ( ) => test . setCryptoKey ( key ) ) . to . throw ( )
432
430
} )
433
431
434
432
it ( 'Precondition: The CryptoKey must match the algorithm suite specification.' , ( ) => {
@@ -467,15 +465,15 @@ describe('decorateWebCryptoMaterial', () => {
467
465
extractable : true ,
468
466
} ,
469
467
}
470
- const trace = expect ( ( ) => test . setCryptoKey ( key , trace ) ) . to . throw ( )
471
- expect ( ( ) => test . setCryptoKey ( key1 , trace ) ) . to . throw ( )
472
- expect ( ( ) => test . setCryptoKey ( key2 , trace ) ) . to . throw ( )
468
+ expect ( ( ) => test . setCryptoKey ( key ) ) . to . throw ( )
469
+ expect ( ( ) => test . setCryptoKey ( key1 ) ) . to . throw ( )
470
+ expect ( ( ) => test . setCryptoKey ( key2 ) ) . to . throw ( )
473
471
} )
474
472
475
473
it ( 'Precondition: dataKey must be a supported type.' , ( ) => {
476
474
const test : any = decorateWebCryptoMaterial ( { } as any )
477
475
const key : any = { }
478
- const trace = expect ( ( ) => test . setCryptoKey ( key , trace ) ) . to . throw ( )
476
+ expect ( ( ) => test . setCryptoKey ( key ) ) . to . throw ( )
479
477
} )
480
478
} )
481
479
0 commit comments