Skip to content

Commit 682b850

Browse files
committed
test: fix multiple expectedWarnings bug
Commit 8fb4ea9 ("test: add deprecation code to expectWarning") did not take into account that the same warning could be expected multiple times. This bug was discovered in #18138 and this commit adds a fix for this issue. PR-URL: #19766 Refs: #18138 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e37effe commit 682b850

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/common/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ function expectWarning(name, expected) {
631631
// Remove a warning message after it is seen so that we guarantee that we
632632
// get each message only once.
633633
map.delete(expected);
634-
}, map.size);
634+
}, expected.length);
635635
}
636636

637637
function expectWarningByName(name, expected, code) {

0 commit comments

Comments
 (0)