|
1 | 1 | const expect = require('expect'); |
2 | 2 | const EventEmitter = require('events'); |
3 | | -const Stats = require('webpack/lib/Stats'); |
4 | | -const MultiStats = require('webpack/lib/MultiStats'); |
| 3 | +const Stats = require('webpack/lib/Stats') |
5 | 4 | const Module = require('webpack/lib/Module'); |
6 | 5 | EventEmitter.prototype.plugin = EventEmitter.prototype.on; |
7 | 6 |
|
@@ -52,53 +51,13 @@ it('friendlyErrors : clearConsole option', () => { |
52 | 51 | expect(plugin.shouldClearConsole).toBeFalsy() |
53 | 52 | }); |
54 | 53 |
|
55 | | - |
56 | | -describe('friendlyErrors : multicompiler', () => { |
57 | | - it('supplies the correct max compile time across multiple stats', () => { |
58 | | - const stats1 = successfulCompilationStats({ startTime: 0, endTime: 1000 }); |
59 | | - const stats2 = successfulCompilationStats({ startTime: 2, endTime: 2002 }); |
60 | | - const multistats = new MultiStats([stats1, stats2]); |
61 | | - |
62 | | - const logs = output.captureLogs(() => { |
63 | | - mockCompiler.emit('done', multistats); |
64 | | - }); |
65 | | - |
66 | | - expect(logs).toEqual([ |
67 | | - 'DONE Compiled successfully in 2000ms', |
68 | | - '' |
69 | | - ]); |
70 | | - }); |
71 | | - |
72 | | - it('supplies the correct recompile time with rebuild', () => { |
73 | | - // Test that rebuilds do not use the prior "max" value when recompiling just one stats object. |
74 | | - // This ensures the user does not get incorrect build times in watch mode. |
75 | | - const stats1 = successfulCompilationStats({ startTime: 0, endTime: 1000 }); |
76 | | - const stats2 = successfulCompilationStats({ startTime: 0, endTime: 500 }); |
77 | | - const stats2Rebuild = successfulCompilationStats({ startTime: 1020, endTime: 1050 }); |
78 | | - |
79 | | - const multistats = new MultiStats([stats1, stats2]); |
80 | | - const multistatsRecompile = new MultiStats([stats1, stats2Rebuild]); |
81 | | - |
82 | | - const logs = output.captureLogs(() => { |
83 | | - mockCompiler.emit('done', multistats); |
84 | | - mockCompiler.emit('done', multistatsRecompile); |
85 | | - }); |
86 | | - |
87 | | - expect(logs).toEqual([ |
88 | | - 'DONE Compiled successfully in 1000ms', |
89 | | - '', |
90 | | - 'DONE Compiled successfully in 30ms', |
91 | | - '' |
92 | | - ]); |
93 | | - }); |
94 | | -}) |
95 | | - |
96 | 54 | function successfulCompilationStats(opts) { |
97 | 55 | const options = Object.assign({ startTime: 0, endTime: 100 }, opts); |
98 | 56 |
|
99 | 57 | const compilation = { |
100 | 58 | errors: [], |
101 | | - warnings: [] |
| 59 | + warnings: [], |
| 60 | + children: [] |
102 | 61 | }; |
103 | 62 | const stats = new Stats(compilation); |
104 | 63 | stats.startTime = options.startTime; |
|
0 commit comments