Skip to content

Commit f9a19c5

Browse files
test: stability
1 parent dc54244 commit f9a19c5

4 files changed

Lines changed: 106 additions & 25 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
'use strict';
2+
3+
const path = require('path');
4+
5+
module.exports = [
6+
{
7+
mode: 'development',
8+
context: path.resolve(__dirname),
9+
entry: './bar.js',
10+
output: {
11+
filename: 'bundle.js',
12+
path: path.resolve(__dirname, '../outputs/dev-server-false-logging/js3'),
13+
publicPath: '/static-one/',
14+
},
15+
infrastructureLogging: {
16+
level: 'none'
17+
},
18+
stats: 'normal',
19+
devServer: false,
20+
},
21+
{
22+
mode: 'development',
23+
context: path.resolve(__dirname),
24+
entry: './foo.js',
25+
output: {
26+
filename: 'bundle.js',
27+
path: path.resolve(__dirname, '../outputs/dev-server-false-logging/js4'),
28+
publicPath: '/static-two/',
29+
},
30+
module: {
31+
rules: [
32+
{
33+
test: /\.(svg|html)$/,
34+
loader: 'file-loader',
35+
options: { name: '[name].[ext]' },
36+
},
37+
],
38+
},
39+
infrastructureLogging: {
40+
level: 'none'
41+
},
42+
stats: 'normal'
43+
}
44+
];
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
'use strict';
2+
3+
const path = require('path');
4+
5+
module.exports = [
6+
{
7+
mode: 'development',
8+
context: path.resolve(__dirname),
9+
entry: './foo.js',
10+
output: {
11+
filename: 'bundle.js',
12+
path: path.resolve(__dirname, '../outputs/array-logging/js1'),
13+
publicPath: '/static-one/',
14+
},
15+
module: {
16+
rules: [
17+
{
18+
test: /\.(svg|html)$/,
19+
loader: 'file-loader',
20+
options: { name: '[name].[ext]' },
21+
},
22+
],
23+
},
24+
infrastructureLogging: {
25+
level: 'none'
26+
},
27+
stats: 'normal'
28+
},
29+
{
30+
mode: 'development',
31+
context: path.resolve(__dirname),
32+
entry: './bar.js',
33+
output: {
34+
filename: 'bundle.js',
35+
path: path.resolve(__dirname, '../outputs/array-logging/js2'),
36+
publicPath: '/static-two/',
37+
},
38+
infrastructureLogging: {
39+
level: 'none'
40+
},
41+
stats: 'normal'
42+
},
43+
];

test/logging.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
457457
const proc = execa(runner, args, {
458458
stdio: "pipe",
459459
env: {
460-
WEBPACK_CONFIG: "webpack.array.config",
460+
WEBPACK_CONFIG: "webpack.array.logging.config.js",
461461
FORCE_COLOR: true,
462462
},
463463
});
@@ -800,7 +800,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
800800
const proc = execa(runner, args, {
801801
stdio: "pipe",
802802
env: {
803-
WEBPACK_CONFIG: "webpack.array.dev-server-false",
803+
WEBPACK_CONFIG: "webpack.array.dev-server-false-logging",
804804
FORCE_COLOR: true,
805805
},
806806
});
@@ -1217,7 +1217,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
12171217
const proc = execa(runner, args, {
12181218
stdio: "pipe",
12191219
env: {
1220-
WEBPACK_CONFIG: "webpack.array.config",
1220+
WEBPACK_CONFIG: "webpack.array.logging.config.js",
12211221
WMC_stats: true,
12221222
FORCE_COLOR: true,
12231223
},
@@ -1256,7 +1256,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
12561256
const proc = execa(runner, args, {
12571257
stdio: "pipe",
12581258
env: {
1259-
WEBPACK_CONFIG: "webpack.array.config",
1259+
WEBPACK_CONFIG: "webpack.array.logging.config.js",
12601260
WMC_stats: false,
12611261
FORCE_COLOR: true,
12621262
},
@@ -1294,7 +1294,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
12941294
const proc = execa(runner, args, {
12951295
stdio: "pipe",
12961296
env: {
1297-
WEBPACK_CONFIG: "webpack.array.config",
1297+
WEBPACK_CONFIG: "webpack.array.logging.config.js",
12981298
WMC_stats: "normal",
12991299
FORCE_COLOR: true,
13001300
},
@@ -1333,7 +1333,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
13331333
const proc = execa(runner, args, {
13341334
stdio: "pipe",
13351335
env: {
1336-
WEBPACK_CONFIG: "webpack.array.config",
1336+
WEBPACK_CONFIG: "webpack.array.logging.config.js",
13371337
WEBPACK_DEV_MIDDLEWARE_STATS: "object",
13381338
FORCE_COLOR: true,
13391339
},
@@ -1372,7 +1372,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
13721372
const proc = execa(runner, args, {
13731373
stdio: "pipe",
13741374
env: {
1375-
WEBPACK_CONFIG: "webpack.array.config",
1375+
WEBPACK_CONFIG: "webpack.array.logging.config.js",
13761376
WEBPACK_DEV_MIDDLEWARE_STATS: "object_colors_true",
13771377
FORCE_COLOR: true,
13781378
},
@@ -1411,7 +1411,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
14111411
const proc = execa(runner, args, {
14121412
stdio: "pipe",
14131413
env: {
1414-
WEBPACK_CONFIG: "webpack.array.config",
1414+
WEBPACK_CONFIG: "webpack.array.logging.config.js",
14151415
WEBPACK_DEV_MIDDLEWARE_STATS: "object_colors_false",
14161416
FORCE_COLOR: true,
14171417
},

test/middleware.test.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3766,23 +3766,17 @@ describe.each([
37663766
}
37673767
});
37683768

3769-
// TODO: why koa and hono don't catch for their error handling when stream emit error?
3770-
(name === "koa" || name === "hono" ? it.skip : it)(
3771-
'should return the "500" code for the "GET" request to the "image.svg" file when it throws a reading error',
3772-
async () => {
3773-
const response = await req.get("/image.svg");
3774-
3775-
// eslint-disable-next-line jest/no-standalone-expect
3776-
expect(response.statusCode).toBe(500);
3777-
if (name !== "hapi") {
3778-
// eslint-disable-next-line jest/no-standalone-expect
3779-
expect(nextWasCalled).toBe(true);
3780-
} else {
3781-
// eslint-disable-next-line jest/no-standalone-expect
3782-
expect(nextWasCalled).toBe(false);
3783-
}
3784-
},
3785-
);
3769+
it('should return the "500" code for the "GET" request to the "image.svg" file when it throws a reading error', async () => {
3770+
const response = await req.get("/image.svg");
3771+
3772+
expect(response.statusCode).toBe(500);
3773+
3774+
if (name !== "hapi") {
3775+
expect(nextWasCalled).toBe(true);
3776+
} else {
3777+
expect(nextWasCalled).toBe(false);
3778+
}
3779+
});
37863780

37873781
it('should return the "200" code for the "HEAD" request to the bundle file', async () => {
37883782
const response = await req.head("/file.text");

0 commit comments

Comments
 (0)