From b6efe2d87620dedac733f67ad912ad1c73ffa927 Mon Sep 17 00:00:00 2001 From: Hemal Patel Date: Mon, 7 Jan 2019 14:28:32 +0530 Subject: [PATCH] tests(watch): use better comments --- .../info-verbosity-off/info-verbosity-off.test.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/binCases/watch/info-verbosity-off/info-verbosity-off.test.js b/test/binCases/watch/info-verbosity-off/info-verbosity-off.test.js index 38ab3067089..d593ba0f4b0 100644 --- a/test/binCases/watch/info-verbosity-off/info-verbosity-off.test.js +++ b/test/binCases/watch/info-verbosity-off/info-verbosity-off.test.js @@ -51,13 +51,17 @@ test.only("info-verbosity-off", async done => { "none" ]); - var outputCount = 0; + var firstTimeOutput = true; var hash1; webpackProc.stdout.on("data", data => { data = data.toString(); - if (outputCount === 0) { + // We get webpack output after running test + // Since we are running the webpack in watch mode, changing file will generate additional output + // First time output will be validated fully + // Hash of the The subsequent output will be tested against that of first time output + if (firstTimeOutput) { hash1 = extractHash(data); const summary = extractSummary(data); @@ -70,7 +74,7 @@ test.only("info-verbosity-off", async done => { // change file appendDataIfFileExists(__dirname, fileToChange, "//junk-comment"); - outputCount++; + firstTimeOutput = false; } else { const hash2 = extractHash(data);