Skip to content

Commit b6efe2d

Browse files
hemal7735evenstensberg
authored andcommitted
tests(watch): use better comments
1 parent f853302 commit b6efe2d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/binCases/watch/info-verbosity-off/info-verbosity-off.test.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,17 @@ test.only("info-verbosity-off", async done => {
5151
"none"
5252
]);
5353

54-
var outputCount = 0;
54+
var firstTimeOutput = true;
5555
var hash1;
5656

5757
webpackProc.stdout.on("data", data => {
5858
data = data.toString();
5959

60-
if (outputCount === 0) {
60+
// We get webpack output after running test
61+
// Since we are running the webpack in watch mode, changing file will generate additional output
62+
// First time output will be validated fully
63+
// Hash of the The subsequent output will be tested against that of first time output
64+
if (firstTimeOutput) {
6165
hash1 = extractHash(data);
6266

6367
const summary = extractSummary(data);
@@ -70,7 +74,7 @@ test.only("info-verbosity-off", async done => {
7074
// change file
7175
appendDataIfFileExists(__dirname, fileToChange, "//junk-comment");
7276

73-
outputCount++;
77+
firstTimeOutput = false;
7478
} else {
7579
const hash2 = extractHash(data);
7680

0 commit comments

Comments
 (0)