Skip to content

Commit 31d94ab

Browse files
committed
Make tests use more webpack 4 goodiness
1 parent 9934724 commit 31d94ab

File tree

10 files changed

+13
-15
lines changed

10 files changed

+13
-15
lines changed

test/Routes.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('Routes', () => {
5252
});
5353

5454
it('GET request to magic html', (done) => {
55-
req.get('/bundle')
55+
req.get('/main')
5656
.expect(200, magicHtml.trim(), done);
5757
});
5858
});
@@ -68,7 +68,7 @@ describe('Routes', () => {
6868
after(helper.close);
6969

7070
it('GET request with headers', (done) => {
71-
req.get('/bundle')
71+
req.get('/main')
7272
.expect('X-Foo', '1')
7373
.expect(200, done);
7474
});
@@ -85,7 +85,7 @@ describe('Routes', () => {
8585
after(helper.close);
8686

8787
it('GET request with headers as an array', (done) => {
88-
req.get('/bundle')
88+
req.get('/main')
8989
.expect('X-Bar', 'key1=value1, key2=value2')
9090
.expect(200, done);
9191
});

test/fixtures/cli/webpack.config.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
'use strict';
22

33
module.exports = {
4+
mode: 'development',
45
context: __dirname,
56
entry: './foo.js',
6-
output: {
7-
filename: 'bundle.js'
8-
},
97
plugins: [{
108
apply(compiler) {
11-
compiler.plugin('done', (stats) => {
9+
compiler.hooks.done.tap('webpack-dev-server', (stats) => {
1210
let exitCode = 0;
1311
if (stats.hasErrors()) {
1412
exitCode = 1;
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

33
module.exports = {
4+
mode: 'development',
45
context: __dirname,
56
entry: './foo.js',
67
output: {
7-
filename: 'bundle.js',
88
publicPath: '/'
99
}
1010
};

test/fixtures/directory-index.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body><ul><li><a href="/bundle.js">bundle.js</a></li><li><a href="/bundle">bundle</a> (magic html for bundle.js) (<a href="/webpack-dev-server/bundle">webpack-dev-server</a>)</li></ul></body></html>
1+
<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body><ul><li><a href="/main.js">main.js</a></li><li><a href="/main">main</a> (magic html for main.js) (<a href="/webpack-dev-server/main">webpack-dev-server</a>)</li></ul></body></html>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

33
module.exports = {
4+
mode: 'development',
45
context: __dirname,
56
entry: './foo.js',
67
output: {
7-
filename: 'bundle.js',
88
path: '/'
99
}
1010
};

test/fixtures/historyapifallback-3-config/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

33
module.exports = {
4+
mode: 'development',
45
context: __dirname,
56
entry: './foo.js',
67
output: {
7-
filename: 'bundle.js',
88
path: '/'
99
},
1010
module: {

test/fixtures/historyapifallback-config/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

33
module.exports = {
4+
mode: 'development',
45
context: __dirname,
56
entry: './foo.js',
67
output: {
7-
filename: 'bundle.js',
88
path: '/'
99
},
1010
module: {

test/fixtures/magic-html.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body><script type="text/javascript" charset="utf-8" src="/bundle.js"></script></body></html>
1+
<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body><script type="text/javascript" charset="utf-8" src="/main.js"></script></body></html>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

33
module.exports = {
4+
mode: 'development',
45
context: __dirname,
56
entry: './foo.js',
67
output: {
7-
filename: 'bundle.js',
88
path: '/'
99
}
1010
};

test/fixtures/simple-config/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

33
module.exports = {
4+
mode: 'development',
45
context: __dirname,
56
entry: './foo.js',
67
output: {
7-
filename: 'bundle.js',
88
path: '/'
99
},
1010
node: false

0 commit comments

Comments
 (0)