GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add a test · webpack/webpack@9c0036b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • ProgressPlugin.test.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/ProgressPlugin.test.js‎

Copy file name to clipboard
+40Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"use strict";
2+
3+
const path = require("path");
4+
const MemoryFs = require("memory-fs");
5+
const webpack = require("../");
6+
7+
const createMultiCompiler = () => {
8+
const compiler = webpack([
9+
{
10+
context: path.join(__dirname, "fixtures"),
11+
entry: "./a.js"
12+
},
13+
{
14+
context: path.join(__dirname, "fixtures"),
15+
entry: "./b.js"
16+
}
17+
]);
18+
compiler.outputFileSystem = new MemoryFs();
19+
return compiler;
20+
};
21+
22+
describe("ProgressPlugin", function() {
23+
it("should not contain NaN as a percentage when it is applied to MultiCompiler", function(done) {
24+
const compiler = createMultiCompiler();
25+
26+
let percentage = 0;
27+
new webpack.ProgressPlugin((p, msg, ...args) => {
28+
percentage += p;
29+
}).apply(compiler);
30+
31+
compiler.run(err => {
32+
if (err) {
33+
throw err;
34+
} else {
35+
expect(percentage).not.toBe(NaN);
36+
done();
37+
}
38+
});
39+
});
40+
});

0 commit comments

Comments
0 (0)
You are visitor 01402622 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.