From 173f8bf900975eaffcfb10dde2489a20e0e7a3d7 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 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. Refs: https://github.com/nodejs/node/pull/18138 --- 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 f13e61df8c8f81..8479aa7a2c089a 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) {