Skip to content

Commit

Permalink
πŸ§›β€β™‚οΈ Check for undefined event parameter (#584)
Browse files Browse the repository at this point in the history
* check for undefined event parameter

closes #583

* Update waffle-chai/src/matchers/emit.ts

Co-authored-by: Przemyslaw Rzad <roopert7@gmail.com>
  • Loading branch information
ItsShadowl and rzadp committed Mar 25, 2022
1 parent 7992daf commit 0719f14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion waffle-chai/src/matchers/emit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function supportEmit(Assertion: Chai.AssertionStatic) {
actualArgs.length
);
for (let index = 0; index < expectedArgs.length; index++) {
if (expectedArgs[index].length !== undefined && typeof expectedArgs[index] !== 'string') {
if (expectedArgs[index]?.length !== undefined && typeof expectedArgs[index] !== 'string') {
for (let j = 0; j < expectedArgs[index].length; j++) {
new Assertion(actualArgs[index][j]).equal(expectedArgs[index][j]);
}
Expand Down

0 comments on commit 0719f14

Please sign in to comment.