From 682b85036efcaa87c580483f68ba71fbb13af4b9 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 3 Apr 2018 07:16:13 +0200 Subject: [PATCH] test: fix multiple expectedWarnings bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 8fb4ea9f75 ("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. PR-URL: https://github.com/nodejs/node/pull/19766 Refs: https://github.com/nodejs/node/pull/18138 Reviewed-By: Tobias Nießen Reviewed-By: James M Snell --- test/common/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/index.js b/test/common/index.js index 1a444f0dbd1..eaae0b53acb 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -631,7 +631,7 @@ function expectWarning(name, expected) { // Remove a warning message after it is seen so that we guarantee that we // get each message only once. map.delete(expected); - }, map.size); + }, expected.length); } function expectWarningByName(name, expected, code) {