Skip to content

Commit a56bd94

Browse files
test: more
1 parent b29d389 commit a56bd94

7 files changed

+2500
-6571
lines changed

package-lock.json

+2,237-6,543
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/__snapshots__/modules-option.test.js.snap

+104-4
Original file line numberDiff line numberDiff line change
@@ -5059,6 +5059,86 @@ Array [
50595059

50605060
exports[`"modules" option should work when the "namedExport" is enabled and the "exportLocalsConvention" options has "dashesOnly" value: warnings 1`] = `Array []`;
50615061

5062+
exports[`"modules" option should work when the 'auto' is not specified with inline module syntax: errors 1`] = `Array []`;
5063+
5064+
exports[`"modules" option should work when the 'auto' is not specified with inline module syntax: module 1 1`] = `
5065+
"// Imports
5066+
import ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \\"../../src/runtime/noSourceMaps.js\\";
5067+
import ___CSS_LOADER_API_IMPORT___ from \\"../../src/runtime/api.js\\";
5068+
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
5069+
// Module
5070+
___CSS_LOADER_EXPORT___.push([module.id, \\".foo {\\\\n color: red;\\\\n}\\\\n\\\\n.blue {\\\\n color: white;\\\\n}\\\\n\\\\n.class { from: custom; }\\", \\"\\"]);
5071+
// Exports
5072+
export default ___CSS_LOADER_EXPORT___;
5073+
"
5074+
`;
5075+
5076+
exports[`"modules" option should work when the 'auto' is not specified with inline module syntax: module 2 1`] = `
5077+
"// Imports
5078+
import ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \\"../../src/runtime/noSourceMaps.js\\";
5079+
import ___CSS_LOADER_API_IMPORT___ from \\"../../src/runtime/api.js\\";
5080+
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
5081+
// Module
5082+
___CSS_LOADER_EXPORT___.push([module.id, \\".tAbfDoQYh1hH8fgy5jt_ {\\\\n color: red;\\\\n}\\\\n\\\\n._h7REYQFFxfq7wKBe15e { from: custom; }\\", \\"\\"]);
5083+
// Exports
5084+
___CSS_LOADER_EXPORT___.locals = {
5085+
\\"some-class\\": \\"tAbfDoQYh1hH8fgy5jt_\\",
5086+
\\"class\\": \\"_h7REYQFFxfq7wKBe15e\\"
5087+
};
5088+
export default ___CSS_LOADER_EXPORT___;
5089+
"
5090+
`;
5091+
5092+
exports[`"modules" option should work when the 'auto' is not specified with inline module syntax: module 3 1`] = `
5093+
"// Imports
5094+
import ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \\"../../src/runtime/noSourceMaps.js\\";
5095+
import ___CSS_LOADER_API_IMPORT___ from \\"../../src/runtime/api.js\\";
5096+
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
5097+
// Module
5098+
___CSS_LOADER_EXPORT___.push([module.id, \\".some-class {\\\\n color: red;\\\\n}\\\\n\\\\n.class { from: custom; }\\", \\"\\"]);
5099+
// Exports
5100+
export default ___CSS_LOADER_EXPORT___;
5101+
"
5102+
`;
5103+
5104+
exports[`"modules" option should work when the 'auto' is not specified with inline module syntax: result 1`] = `
5105+
Array [
5106+
Array [
5107+
"other.css!=!./my-inline-loader/index.js!./index-loader-syntax.modules.css",
5108+
".foo {
5109+
color: red;
5110+
}
5111+
5112+
.blue {
5113+
color: white;
5114+
}
5115+
5116+
.class { from: custom; }",
5117+
"",
5118+
],
5119+
Array [
5120+
"other.modules.css!=!./my-inline-loader/index.js!./simple.css",
5121+
".tAbfDoQYh1hH8fgy5jt_ {
5122+
color: red;
5123+
}
5124+
5125+
._h7REYQFFxfq7wKBe15e { from: custom; }",
5126+
"",
5127+
],
5128+
Array [
5129+
"other.css!=!./my-inline-loader/index.js!./simple-1.css",
5130+
".some-class {
5131+
color: red;
5132+
}
5133+
5134+
.class { from: custom; }",
5135+
"",
5136+
],
5137+
]
5138+
`;
5139+
5140+
exports[`"modules" option should work when the 'auto' is not specified with inline module syntax: warnings 1`] = `Array []`;
5141+
50625142
exports[`"modules" option should work with "exportOnlyLocals" and "esModule" with "false" value options: errors 1`] = `Array []`;
50635143

50645144
exports[`"modules" option should work with "exportOnlyLocals" and "esModule" with "false" value options: module 1`] = `
@@ -5414,9 +5494,9 @@ Object {
54145494

54155495
exports[`"modules" option should work with "exportOnlyLocals" and "namedExport" option: warnings 1`] = `Array []`;
54165496

5417-
exports[`"modules" option should work with "false" alises: errors 1`] = `Array []`;
5497+
exports[`"modules" option should work with "false" aliases: errors 1`] = `Array []`;
54185498

5419-
exports[`"modules" option should work with "false" alises: module 1`] = `
5499+
exports[`"modules" option should work with "false" aliases: module 1`] = `
54205500
"// Imports
54215501
import ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \\"../../../../src/runtime/noSourceMaps.js\\";
54225502
import ___CSS_LOADER_API_IMPORT___ from \\"../../../../src/runtime/api.js\\";
@@ -5431,7 +5511,7 @@ export default ___CSS_LOADER_EXPORT___;
54315511
"
54325512
`;
54335513

5434-
exports[`"modules" option should work with "false" alises: result 1`] = `
5514+
exports[`"modules" option should work with "false" aliases: result 1`] = `
54355515
Array [
54365516
Array [
54375517
"./modules/icss-false-alias/relative.icss.css",
@@ -5444,7 +5524,7 @@ Array [
54445524
]
54455525
`;
54465526

5447-
exports[`"modules" option should work with "false" alises: warnings 1`] = `Array []`;
5527+
exports[`"modules" option should work with "false" aliases: warnings 1`] = `Array []`;
54485528

54495529
exports[`"modules" option should work with "url" and "namedExport": errors 1`] = `Array []`;
54505530

@@ -15107,6 +15187,26 @@ Array [
1510715187

1510815188
exports[`"modules" option should work with the "namedExport" option: warnings 1`] = `Array []`;
1510915189

15190+
exports[`"modules" option should work with the 'auto' and exctract CSS using mini-css-extract-plugin: css 1`] = `
15191+
"/*!*****************************************************************!*\\\\
15192+
!*** css ../../src/index.js!./modules/mode/relative.module.css ***!
15193+
\\\\*****************************************************************/
15194+
.IU1H9vP4cpzQT_RvUQ84 {
15195+
color: red;
15196+
}
15197+
15198+
"
15199+
`;
15200+
15201+
exports[`"modules" option should work with the 'auto' and exctract CSS using mini-css-extract-plugin: errors 1`] = `Array []`;
15202+
15203+
exports[`"modules" option should work with the 'auto' and exctract CSS using mini-css-extract-plugin: module 1`] = `
15204+
"// extracted by mini-css-extract-plugin
15205+
export default {\\"relative\\":\\"IU1H9vP4cpzQT_RvUQ84\\"};"
15206+
`;
15207+
15208+
exports[`"modules" option should work with the 'auto' and exctract CSS using mini-css-extract-plugin: warnings 1`] = `Array []`;
15209+
1511015210
exports[`"modules" option should work with the \`exportGlobals\` option (the \`mode\` option is \`global\`): errors 1`] = `Array []`;
1511115211

1511215212
exports[`"modules" option should work with the \`exportGlobals\` option (the \`mode\` option is \`global\`): module 1`] = `

test/__snapshots__/url-option.test.js.snap

+88-22
Original file line numberDiff line numberDiff line change
@@ -2588,11 +2588,11 @@ exports[`"url" option should work with mini-css-extract-plugin: css 1`] = `
25882588
}
25892589

25902590
.class {
2591-
background: green url( \\"/webpack/public/path/img img.png\\" ) xyz;
2591+
background: green url( \\"/webpack/public/path/img%20img.png\\" ) xyz;
25922592
}
25932593

25942594
.class {
2595-
background: green url( \\"/webpack/public/path/img img.png\\" ) xyz;
2595+
background: green url( \\"/webpack/public/path/img%20img.png\\" ) xyz;
25962596
}
25972597

25982598
.class {
@@ -2632,11 +2632,11 @@ exports[`"url" option should work with mini-css-extract-plugin: css 1`] = `
26322632
url(/webpack/public/path/font.woff2) format('woff2'),
26332633
url(/webpack/public/path/font.eot) format('eot'),
26342634
url(/webpack/public/path/font.ttf) format('truetype'),
2635-
url(\\"/webpack/public/path/font with spaces.eot\\") format(\\"embedded-opentype\\"),
2635+
url(\\"/webpack/public/path/font%20with%20spaces.eot\\") format(\\"embedded-opentype\\"),
26362636
url(/webpack/public/path/font.svg#svgFontName) format('svg'),
26372637
url(/webpack/public/path/font.woff2) format('woff2'),
26382638
url(/webpack/public/path/font.eot?#iefix) format('embedded-opentype'),
2639-
url(\\"/webpack/public/path/font with spaces.eot?#iefix\\") format('embedded-opentype');
2639+
url(\\"/webpack/public/path/font%20with%20spaces.eot?#iefix\\") format('embedded-opentype');
26402640
}
26412641

26422642
@media (min-width: 500px) {
@@ -2785,7 +2785,7 @@ a {
27852785
background-image: -webkit-image-set(\\"/webpack/public/path/img1x.png\\" 1x, \\"/webpack/public/path/img2x.png\\" 2x);
27862786
background-image: image-set(\\"/webpack/public/path/img1x.png\\" 1x);
27872787
background-image: image-set(\\"/webpack/public/path/img1x.png\\" 1x, \\"/webpack/public/path/img2x.png\\" 2x);
2788-
background-image: image-set(\\"/webpack/public/path/img img.png\\" 1x, \\"/webpack/public/path/img img.png\\" 2x);
2788+
background-image: image-set(\\"/webpack/public/path/img%20img.png\\" 1x, \\"/webpack/public/path/img%20img.png\\" 2x);
27892789
background-image: image-set(\\"/webpack/public/path/img1x.png\\" 1x, \\"/webpack/public/path/img2x.png\\" 2x),
27902790
image-set(\\"/webpack/public/path/img1x.png\\" 1x, \\"/webpack/public/path/img2x.png\\" 2x);
27912791
background-image: image-set(
@@ -2813,7 +2813,7 @@ a {
28132813
url(/webpack/public/path/img2x.png) 2x,
28142814
url(/webpack/public/path/img3x.png) 600dpi
28152815
);
2816-
background-image: image-set(url(\\"/webpack/public/path/img img.png\\") 1x, url(\\"/webpack/public/path/img img.png\\") 2x);
2816+
background-image: image-set(url(\\"/webpack/public/path/img%20img.png\\") 1x, url(\\"/webpack/public/path/img%20img.png\\") 2x);
28172817

28182818
background-image: image-set(url(/webpack/public/path/img1x.png) 1x, \\"/webpack/public/path/img2x.png\\" 2x);
28192819
}
@@ -2825,8 +2825,8 @@ a {
28252825
background: url(\\"/webpack/public/path/img'''img.png\\");
28262826
background: url(\\"/webpack/public/path/img(img.png\\");
28272827
background: url(\\"/webpack/public/path/img)img.png\\");
2828-
background: url(\\"/webpack/public/path/img img.png\\");
2829-
background: url(\\"/webpack/public/path/img'() img.png\\");
2828+
background: url(\\"/webpack/public/path/img%20img.png\\");
2829+
background: url(\\"/webpack/public/path/img'()%20img.png\\");
28302830

28312831
background-image: image-set(
28322832
/* Not allowed on windows */
@@ -2835,19 +2835,19 @@ a {
28352835
url(\\"/webpack/public/path/img'img.png\\") 3x,
28362836
url(\\"/webpack/public/path/img(img.png\\") 4x,
28372837
url(\\"/webpack/public/path/img)img.png\\") 5x,
2838-
url(\\"/webpack/public/path/img img.png\\") 6x,
2839-
url(\\"/webpack/public/path/img'() img.png\\") 7x
2838+
url(\\"/webpack/public/path/img%20img.png\\") 6x,
2839+
url(\\"/webpack/public/path/img'()%20img.png\\") 7x
28402840
);
28412841
}
28422842

28432843
.class-class-class {
28442844
background: url(\\"/webpack/public/path/img'''img.png\\");
2845-
background: url(\\"/webpack/public/path/img'() img.png\\");
2845+
background: url(\\"/webpack/public/path/img'()%20img.png\\");
28462846
background: url(\\"/webpack/public/path/img'img.png\\");
28472847
background: url(\\"/webpack/public/path/img(img.png\\");
28482848
background: url(\\"/webpack/public/path/img)img.png\\");
2849-
background: url(\\"/webpack/public/path/img img.png\\");
2850-
background: url(\\"/webpack/public/path/img img.png\\");
2849+
background: url(\\"/webpack/public/path/img%20img.png\\");
2850+
background: url(\\"/webpack/public/path/img%20img.png\\");
28512851
}
28522852

28532853
/* Comment */
@@ -2861,17 +2861,17 @@ a {
28612861

28622862
.other-test-case {
28632863
background: url(\\"/webpack/public/path/img'''img.png\\");
2864-
background: url(\\"/webpack/public/path/img'() img.png\\");
2864+
background: url(\\"/webpack/public/path/img'()%20img.png\\");
28652865
background: url(\\"/webpack/public/path/img'img.png\\");
28662866
background: url(\\"/webpack/public/path/img(img.png\\");
28672867
background: url(\\"/webpack/public/path/img)img.png\\");
2868-
background: url(\\"/webpack/public/path/img img.png\\");
2868+
background: url(\\"/webpack/public/path/img%20img.png\\");
28692869
background: url(\\"/webpack/public/path/img'''img.png\\");
2870-
background: url(\\"/webpack/public/path/img'() img.png\\");
2870+
background: url(\\"/webpack/public/path/img'()%20img.png\\");
28712871
background: url(\\"/webpack/public/path/img'img.png\\");
28722872
background: url(\\"/webpack/public/path/img(img.png\\");
28732873
background: url(\\"/webpack/public/path/img)img.png\\");
2874-
background: url(\\"/webpack/public/path/img img.png\\");
2874+
background: url(\\"/webpack/public/path/img%20img.png\\");
28752875
}
28762876

28772877
.qqq {
@@ -2880,16 +2880,16 @@ a {
28802880

28812881
.www {
28822882
background: url(\\"/webpack/public/path/img'''img.png\\");
2883-
background: url(\\"/webpack/public/path/img'() img.png\\");
2883+
background: url(\\"/webpack/public/path/img'()%20img.png\\");
28842884
background: url(\\"/webpack/public/path/img'img.png\\");
28852885
background: url(\\"/webpack/public/path/img(img.png\\");
28862886
background: url(\\"/webpack/public/path/img)img.png\\");
2887-
background: url(\\"/webpack/public/path/img img.png\\");
2887+
background: url(\\"/webpack/public/path/img%20img.png\\");
28882888
background: url(/webpack/public/path/img.png);
28892889
background: url(/webpack/public/path/img.png);
28902890
background: url(\\"/webpack/public/path/img'img.png\\");
2891-
background: url(\\"/webpack/public/path/img'() img.png\\");
2892-
background: url(\\"/webpack/public/path/img'() img.png\\");
2891+
background: url(\\"/webpack/public/path/img'()%20img.png\\");
2892+
background: url(\\"/webpack/public/path/img'()%20img.png\\");
28932893
}
28942894

28952895
.class {
@@ -2977,7 +2977,73 @@ exports[`"url" option should work with mini-css-extract-plugin: module 1`] = `
29772977
export {};"
29782978
`;
29792979

2980-
exports[`"url" option should work with mini-css-extract-plugin: warnings 1`] = `Array []`;
2980+
exports[`"url" option should work with mini-css-extract-plugin: warnings 1`] = `
2981+
Array [
2982+
"ModuleWarning: Module Warning (from \`replaced original path\`):
2983+
Warning
2984+
2985+
(120:3) Unable to find uri in 'background: green url() xyz'",
2986+
"ModuleWarning: Module Warning (from \`replaced original path\`):
2987+
Warning
2988+
2989+
(124:3) Unable to find uri in 'background: green url('') xyz'",
2990+
"ModuleWarning: Module Warning (from \`replaced original path\`):
2991+
Warning
2992+
2993+
(128:3) Unable to find uri in 'background: green url(\\"\\") xyz'",
2994+
"ModuleWarning: Module Warning (from \`replaced original path\`):
2995+
Warning
2996+
2997+
(132:3) Unable to find uri in 'background: green url(' ') xyz'",
2998+
"ModuleWarning: Module Warning (from \`replaced original path\`):
2999+
Warning
3000+
3001+
(136:3) Unable to find uri in 'background: green url(
3002+
) xyz'",
3003+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3004+
Warning
3005+
3006+
(216:3) Unable to find uri in 'background-image: -webkit-image-set('')'",
3007+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3008+
Warning
3009+
3010+
(218:3) Unable to find uri in 'background-image: image-set('')'",
3011+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3012+
Warning
3013+
3014+
(219:3) Unable to find uri in 'background-image: image-set(\\"\\")'",
3015+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3016+
Warning
3017+
3018+
(220:3) Unable to find uri in 'background-image: image-set(\\"\\" 1x)'",
3019+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3020+
Warning
3021+
3022+
(221:3) Unable to find uri in 'background-image: image-set(url())'",
3023+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3024+
Warning
3025+
3026+
(222:3) Unable to find uri in 'background-image: image-set(
3027+
url()
3028+
)'",
3029+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3030+
Warning
3031+
3032+
(225:3) Unable to find uri in 'background-image: image-set(URL())'",
3033+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3034+
Warning
3035+
3036+
(226:3) Unable to find uri in 'background-image: image-set(url(''))'",
3037+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3038+
Warning
3039+
3040+
(227:3) Unable to find uri in 'background-image: image-set(url(\\"\\"))'",
3041+
"ModuleWarning: Module Warning (from \`replaced original path\`):
3042+
Warning
3043+
3044+
(228:3) Unable to find uri in 'background-image: image-set(url('') 1x)'",
3045+
]
3046+
`;
29813047

29823048
exports[`"url" option should work with the 'asset' type of asset modules: errors 1`] = `Array []`;
29833049

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import one from 'other.css!=!./my-inline-loader!./index-loader-syntax.modules.css';
2+
import two from 'other.modules.css!=!./my-inline-loader!./simple.css';
3+
import three from 'other.css!=!./my-inline-loader!./simple-1.css';
4+
5+
__export__ = [...one, ...two, ...three];
6+
7+
export default [...one, ...two, ...three];

test/fixtures/simple-1.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.some-class {
2+
color: red;
3+
}

0 commit comments

Comments
 (0)