diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-07-12 02:55:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-12 02:55:57 +0800 |
commit | c615a1e80aa0960fa7eb888e1bc085e70d3c7bfe (patch) | |
tree | e2493a9842e31d154274fb383a5dd8e9b17ebc90 | |
parent | 10a938cb79d19e1476e2744c8651011fd4d7b902 (diff) | |
download | tracifyjs-c615a1e80aa0960fa7eb888e1bc085e70d3c7bfe.tar.gz tracifyjs-c615a1e80aa0960fa7eb888e1bc085e70d3c7bfe.zip |
fix gzip stream in `test/benchmark.js` (#2228)
-rw-r--r-- | test/benchmark.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/benchmark.js b/test/benchmark.js index 569d4476..8b20ec13 100644 --- a/test/benchmark.js +++ b/test/benchmark.js @@ -64,14 +64,13 @@ urls.forEach(function(url) { }).pipe(uglifyjs.stdin); uglifyjs.stdout.on("data", function(data) { results[url].output += data.length; - }).pipe(createHash("sha1")).on("data", function(data) { - results[url].sha1 = data.toString("hex"); - done(); - }); - uglifyjs.stdout.pipe(zlib.createGzip({ + }).pipe(zlib.createGzip({ level: zlib.Z_BEST_COMPRESSION })).on("data", function(data) { results[url].gzip += data.length; + }).pipe(createHash("sha1")).on("data", function(data) { + results[url].sha1 = data.toString("hex"); + done(); }); uglifyjs.stderr.setEncoding("utf8"); uglifyjs.stderr.on("data", function(data) { |