GeezerVison is showing github.com — Modified Tests as suggested. · webpack/webpack@0128118
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +30Lines changed: 30 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +"use strict"; |
| 2 | + |
| 3 | +const path = require("path"); |
| 4 | +const fs = require("fs"); |
| 5 | +const webpack = require("../"); |
| 6 | +const rimraf = require("rimraf"); |
| 7 | + |
| 8 | +describe("Profiling Plugin", function() { |
| 9 | + it("should handle output path with folder creation", done => { |
| 10 | + const finalPath = "test/js/profilingPath/events.json"; |
| 11 | + const outputPath = path.join(__dirname, "/js/profilingPath"); |
| 12 | + rimraf(outputPath, () => { |
| 13 | + const compiler = webpack({ |
| 14 | + context: "/", |
| 15 | + entry: "./fixtures/a.js", |
| 16 | + plugins: [ |
| 17 | + new webpack.debug.ProfilingPlugin({ |
| 18 | + outputPath: finalPath |
| 19 | + }) |
| 20 | + ] |
| 21 | + }); |
| 22 | + compiler.run(err => { |
| 23 | + if (err) return done(err); |
| 24 | + if (!fs.existsSync(outputPath)) |
| 25 | + return done(new Error("Folder should be created.")); |
| 26 | + done(); |
| 27 | + }); |
| 28 | + }); |
| 29 | + }); |
| 30 | +}); |
Collapse file
Copy file name to clipboardExpand all lines: test/ProfilingPlugin.unittest.js -23Lines changed: 0 additions & 23 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | "use strict"; |
2 | 2 |
|
3 | 3 | const ProfilingPlugin = require("../lib/debug/ProfilingPlugin"); |
4 | | -const path = require("path"); |
5 | | -const fs = require("fs"); |
6 | | -const webpack = require("../"); |
7 | 4 |
|
8 | 5 | describe("Profiling Plugin", () => { |
9 | 6 | it("should persist the passed outpath", () => { |
@@ -18,26 +15,6 @@ describe("Profiling Plugin", () => { |
18 | 15 | expect(plugin.outputPath).toBe("events.json"); |
19 | 16 | }); |
20 | 17 |
|
21 | | - it("should handle outpath with folder", done => { |
22 | | - const finalPath = "test/fixtures/profilingPath/events.json"; |
23 | | - const compiler = webpack({ |
24 | | - context: "/", |
25 | | - entry: "./fixtures/a.js", |
26 | | - plugins: [ |
27 | | - new webpack.debug.ProfilingPlugin({ |
28 | | - outputPath: finalPath |
29 | | - }) |
30 | | - ] |
31 | | - }); |
32 | | - const outputPath = path.join(__dirname, "/fixtures/profilingPath"); |
33 | | - compiler.run(err => { |
34 | | - if (err) return done(err); |
35 | | - if (!fs.existsSync(outputPath)) |
36 | | - return done(new Error("Folder should be created.")); |
37 | | - done(); |
38 | | - }); |
39 | | - }); |
40 | | - |
41 | 18 | it("should handle when unable to require the inspector", () => { |
42 | 19 | const profiler = new ProfilingPlugin.Profiler(); |
43 | 20 | return profiler.startProfiling(); |
|