Skip to content

Commit

Permalink
tests(watch): use better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hemal7735 authored and evenstensberg committed Feb 5, 2019
1 parent f853302 commit b6efe2d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit b6efe2d

Please sign in to comment.