test: fix multiple expectedWarnings bug
Commit 8fb4ea9f ("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 https://github.com/nodejs/node/pull/18138 and this commit adds a fix for this issue.
Refs: https://github.com/nodejs/node/pull/18138
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines