Skip to content

Commit 37a40bb

Browse files
test: fix problem with nothing (webpack-contrib#942)
1 parent 05a42e2 commit 37a40bb

File tree

4 files changed

+39
-26
lines changed

4 files changed

+39
-26
lines changed

package-lock.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
"webpack": "^4.0.0"
4242
},
4343
"dependencies": {
44+
"camelcase": "^5.2.0",
4445
"cssesc": "^3.0.0",
4546
"icss-utils": "^4.1.0",
4647
"loader-utils": "^1.2.3",
47-
"camelcase": "^5.2.0",
4848
"normalize-path": "^3.0.0",
4949
"postcss": "^7.0.14",
5050
"postcss-modules-extract-imports": "^2.0.0",

test/__snapshots__/loader.test.js.snap

+28-16
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ exports[`loader should compile with \`css\` entry point (with \`modules\` and sc
127127
exports[`loader should compile with \`css\` entry point (with \`modules\` and scope \`global\`): module (evaluated) 1`] = `
128128
Array [
129129
Array [
130-
null,
131-
"nothing",
130+
2,
131+
".foo {
132+
color: red;
133+
}
134+
",
132135
"",
133136
],
134137
Array [
@@ -139,11 +142,11 @@ Array [
139142
140143
.class {
141144
color: red;
142-
background: url(nothing);
145+
background: url(/webpack/public/path/img.png);
143146
}
144147
145148
.class-duplicate-url {
146-
background: url(nothing);
149+
background: url(/webpack/public/path/img.png);
147150
}
148151
149152
:root {
@@ -416,8 +419,11 @@ exports[`loader should compile with \`css\` entry point (with \`modules\` and sc
416419
exports[`loader should compile with \`css\` entry point (with \`modules\` and scope \`local\`): module (evaluated) 1`] = `
417420
Array [
418421
Array [
419-
null,
420-
"nothing",
422+
2,
423+
".KTxgbb6qrDrjy0obHlZaJ {
424+
color: red;
425+
}
426+
",
421427
"",
422428
],
423429
Array [
@@ -428,11 +434,11 @@ Array [
428434
429435
._1PSZ4tK4URrenXyNSoawrx {
430436
color: red;
431-
background: url(nothing);
437+
background: url(/webpack/public/path/img.png);
432438
}
433439
434440
._3YYoEr128Gk7ZgfRycu4tr {
435-
background: url(nothing);
441+
background: url(/webpack/public/path/img.png);
436442
}
437443
438444
:root {
@@ -729,8 +735,11 @@ exports[`loader should compile with \`css\` entry point: escape 1`] = `
729735
exports[`loader should compile with \`css\` entry point: module (evaluated) 1`] = `
730736
Array [
731737
Array [
732-
null,
733-
"nothing",
738+
2,
739+
".foo {
740+
color: red;
741+
}
742+
",
734743
"",
735744
],
736745
Array [
@@ -741,11 +750,11 @@ Array [
741750
742751
.class {
743752
color: red;
744-
background: url(nothing);
753+
background: url(/webpack/public/path/img.png);
745754
}
746755
747756
.class-duplicate-url {
748-
background: url(nothing);
757+
background: url(/webpack/public/path/img.png);
749758
}
750759
751760
:root {
@@ -1018,8 +1027,11 @@ exports[`loader should compile with \`js\` entry point: escape 1`] = `
10181027
exports[`loader should compile with \`js\` entry point: module (evaluated) 1`] = `
10191028
Array [
10201029
Array [
1021-
null,
1022-
"nothing",
1030+
2,
1031+
".foo {
1032+
color: red;
1033+
}
1034+
",
10231035
"",
10241036
],
10251037
Array [
@@ -1030,11 +1042,11 @@ Array [
10301042
10311043
.class {
10321044
color: red;
1033-
background: url(nothing);
1045+
background: url(/webpack/public/path/img.png);
10341046
}
10351047
10361048
.class-duplicate-url {
1037-
background: url(nothing);
1049+
background: url(/webpack/public/path/img.png);
10381050
}
10391051
10401052
:root {

test/helpers.js

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function evaluated(output, modules, moduleId = 1) {
5858
'modules/tests-cases/composes-multiple',
5959
'modules/tests-cases/composes-with-importing',
6060
'modules/tests-cases/media-2',
61+
'.',
6162
].map((importedPath) =>
6263
path.resolve(
6364
__dirname,

0 commit comments

Comments
 (0)