File tree 4 files changed +70
-35
lines changed
4 files changed +70
-35
lines changed Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Multi compiler should work with multiple compilers: console messages 1`] = `
4
+ Array [
5
+ "[HMR] Waiting for update signal from WDS...",
6
+ "Hey.",
7
+ "[webpack-dev-server] Hot Module Replacement enabled.",
8
+ "[webpack-dev-server] Live Reloading enabled.",
9
+ ]
10
+ `;
11
+
12
+ exports[`Multi compiler should work with multiple compilers: page errors 1`] = `Array []`;
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Multi compiler should work with multiple compilers: console messages 1`] = `
4
+ Array [
5
+ "[HMR] Waiting for update signal from WDS...",
6
+ "Hey.",
7
+ "[webpack-dev-server] Hot Module Replacement enabled.",
8
+ "[webpack-dev-server] Live Reloading enabled.",
9
+ ]
10
+ `;
11
+
12
+ exports[`Multi compiler should work with multiple compilers: page errors 1`] = `Array []`;
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ const webpack = require ( "webpack" ) ;
4
+ const Server = require ( "../../lib/Server" ) ;
5
+ const config = require ( "../fixtures/multi-compiler-config/webpack.config" ) ;
6
+ const runBrowser = require ( "../helpers/run-browser" ) ;
7
+ const port = require ( "../ports-map" ) [ "multi-compiler" ] ;
8
+
9
+ describe ( "Multi compiler" , ( ) => {
10
+ it ( `should work with multiple compilers` , async ( ) => {
11
+ const compiler = webpack ( config ) ;
12
+ const devServerOptions = {
13
+ host : "127.0.0.1" ,
14
+ port,
15
+ } ;
16
+ const server = new Server ( devServerOptions , compiler ) ;
17
+
18
+ await server . start ( ) ;
19
+
20
+ const { page, browser } = await runBrowser ( ) ;
21
+
22
+ const pageErrors = [ ] ;
23
+ const consoleMessages = [ ] ;
24
+
25
+ page
26
+ . on ( "console" , ( message ) => {
27
+ consoleMessages . push ( message ) ;
28
+ } )
29
+ . on ( "pageerror" , ( error ) => {
30
+ pageErrors . push ( error ) ;
31
+ } ) ;
32
+
33
+ await page . goto ( `http://127.0.0.1:${ port } /main` , {
34
+ waitUntil : "networkidle0" ,
35
+ } ) ;
36
+
37
+ expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshot (
38
+ "console messages"
39
+ ) ;
40
+
41
+ expect ( pageErrors ) . toMatchSnapshot ( "page errors" ) ;
42
+
43
+ await browser . close ( ) ;
44
+ await server . close ( ) ;
45
+ } ) ;
46
+ } ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments