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
it("Should succeed when predicate passes",asyncfunction(){
400
+
awaitexpect(contract.emitUintArray(1,2))
401
+
.to.emit(contract,"WithUintArray")
402
+
.withArgs([anyValue,2]);
403
+
});
404
+
405
+
it("Should fail when predicate returns false",asyncfunction(){
406
+
awaitexpect(
407
+
expect(contract.emitUintArray(1,2))
408
+
.to.emit(contract,"WithUintArray")
409
+
.withArgs([()=>false,4])
410
+
).to.be.eventually.rejectedWith(
411
+
AssertionError,
412
+
`Error in "WithUintArray" event: Error in the 1st argument assertion: Error in the 1st argument assertion: The predicate did not return true`
413
+
);
414
+
});
415
+
416
+
it("Should fail when predicate reverts",asyncfunction(){
417
+
awaitexpect(
418
+
expect(contract.emitUintArray(1,2))
419
+
.to.emit(contract,"WithUintArray")
420
+
.withArgs([
421
+
()=>{
422
+
thrownewError("user error");
423
+
},
424
+
4,
425
+
])
426
+
).to.be.eventually.rejectedWith(
427
+
AssertionError,
428
+
`Error in "WithUintArray" event: Error in the 1st argument assertion: Error in the 1st argument assertion: The predicate threw when called: user error`
429
+
);
430
+
});
431
+
});
432
+
394
433
describe("arrays different length",function(){
395
434
it("Should fail when the array is shorter",asyncfunction(){
0 commit comments