Skip to content

Commit

Permalink
test: more (#952)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Jun 4, 2019
1 parent c3fd459 commit 0672e78
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 22 deletions.
23 changes: 20 additions & 3 deletions test/__snapshots__/exportOnlyLocals-option.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,24 @@ exports[`modules true (mode: local): module 1`] = `
\\"v-primary\\": \\"#BF4040\\",
\\"s-black\\": \\"black-selector\\",
\\"m-large\\": \\"(min-width: 960px)\\",
\\"v-string\\": \\"'my-content'\\",
\\"v-empty-string\\": \\"''\\",
\\"v-ident\\": \\"validIdent\\",
\\"v-pre-defined-ident\\": \\"left\\",
\\"v-string\\": \\"'content'\\",
\\"v-string-1\\": \\"''\\",
\\"v-url\\": \\"url(https://www.exammple.com/images/my-background.png)\\",
\\"v-url-1\\": \\"url('https://www.exammple.com/images/my-background.png')\\",
\\"v-url-2\\": \\"url(\\\\\\"https://www.exammple.com/images/my-background.png\\\\\\")\\",
\\"v-integer\\": \\"100\\",
\\"v-integer-1\\": \\"-100\\",
\\"v-integer-2\\": \\"+100\\",
\\"v-number\\": \\".60\\",
\\"v-number-1\\": \\"-456.8\\",
\\"v-number-2\\": \\"-3.4e-2\\",
\\"v-dimension\\": \\"12px\\",
\\"v-percentage\\": \\"100%\\",
\\"v-hex\\": \\"#fff\\",
\\"v-function\\": \\"rgb(0,0,0)\\",
\\"v-unicode-range\\": \\"U+0025-00FF\\",
\\"ghi\\": \\"_ghi\\",
\\"class\\": \\"_class\\",
\\"other\\": \\"_other\\",
Expand All @@ -29,7 +45,8 @@ exports[`modules true (mode: local): module 1`] = `
\\"alias\\": \\"_alias \\" + require(\\"-!../../../src/index.js??ref--4-0!aliasesComposes/alias.css\\")[\\"imported-alias\\"] + \\"\\",
\\"primary-selector\\": \\"_primary-selector\\",
\\"black-selector\\": \\"_black-selector\\",
\\"header\\": \\"_header\\"
\\"header\\": \\"_header\\",
\\"foobarbaz\\": \\"_foobarbaz\\"
};"
`;

Expand Down
62 changes: 50 additions & 12 deletions test/__snapshots__/modules-option.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6093,24 +6093,45 @@ Array [
padding: 20px 20px;
}
}
@value v-comment: /* comment */;
._3qS0_85PLYhk_pNQ69KfSo {
v-ident: validIdent;
v-pre-defined-ident: left;
v-string: 'content';
v-string-1: '';
v-url: url(https://www.exammple.com/images/my-background.png);
v-url-1: url('https://www.exammple.com/images/my-background.png');
v-url-2: url(\\"https://www.exammple.com/images/my-background.png\\");
v-integer: 100;
v-integer-1: -100;
v-integer-2: +100;
v-number: .60;
v-number-1: -456.8;
v-number-2: -3.4e-2;
v-dimension: 12px;
v-percentage: 100%;
v-hex: #fff;
v-comment: v-comment 10px v-comment;
v-function: rgb(0,0,0);
v-unicode-range: U+0025-00FF;
mutliple: #fff .60 100%;
}
a {
content: 'my-content';
content: 'content';
}
@supports (content: 'my-content') {
@supports (content: 'content') {
a {
content: 'my-content';
content: 'content';
}
}
[class~='my-content'] {
[class~='content'] {
color:green;
}
a {
content: '';
}
",
"",
],
Expand All @@ -6130,7 +6151,7 @@ exports.i(require(\\"-!../../../src/index.js??ref--4-0!aliasesComposes/alias.css
exports.i(require(\\"-!../../../src/index.js??ref--4-0!./test-other.css\\"), \\"(min-width: 100px)\\");
// Module
exports.push([module.id, \\"._14uFt0lIVKKAlKTTT29IIQ {\\\\n color: \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"v-def\\"] + \\";\\\\n}\\\\n\\\\n._3XDgIzfUIQkaUInpEdo7fN {\\\\n color: blue;\\\\n}\\\\n\\\\n._1wABXM_RabWHj--wsPrhvM {\\\\n display: block;\\\\n}\\\\n\\\\n._1DFEYnAfn9LZyk4fErI86e {\\\\n width: \\" + require(\\"-!../../../src/index.js??ref--4-0!./something.css\\").locals[\\"v-something\\"] + \\";\\\\n}\\\\n\\\\n.Ywv5coVC2RU-pIFhN9O4w {\\\\n color: \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"v-other\\"] + \\";\\\\n}\\\\n\\\\n._1tAbIwITRWAdZZE6wKNk9O {\\\\n prop: \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"v-def\\"] + \\";\\\\n duplicate: \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"v-other\\"] + \\";\\\\n}\\\\n\\\\n.Q3SQ3BwtBwUFLlg6adzOI {\\\\n color: red;\\\\n}\\\\n\\\\n._1n5XhXj4SFnYrwziC3un0d {\\\\n color: yellow;\\\\n}\\\\n\\\\n._3dnFnGkAVAiMA6etF-naHc {\\\\n color: gray;\\\\n}\\\\n\\\\n._1xUePnlnafMQ1cExy3PUWT {\\\\n color: gray;\\\\n}\\\\n\\\\n._26Jdfenl9Xn8HXwb2jipvt {\\\\n color: gainsboro;\\\\n}\\\\n\\\\n._1ya4VhsDkuPhQeVHQydw2Y {\\\\n color: #BF4040;\\\\n}\\\\n\\\\n.sGE1Q_LliVEZU2Q4q9j4K {\\\\n color: black;\\\\n}\\\\n\\\\n@media (min-width: 960px) {\\\\n ._2zSMJ4hQh0FesbZjiKW_ya {\\\\n padding: 0 20px;\\\\n }\\\\n}\\\\n\\\\n.\\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"s-white\\"] + \\" {\\\\n color: white;\\\\n}\\\\n\\\\n@media \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"m-small\\"] + \\" {\\\\n ._2zSMJ4hQh0FesbZjiKW_ya {\\\\n padding: 20px 20px;\\\\n }\\\\n}\\\\n\\\\na {\\\\n content: 'my-content';\\\\n}\\\\n\\\\n@supports (content: 'my-content') {\\\\n a {\\\\n content: 'my-content';\\\\n }\\\\n}\\\\n\\\\n[class~='my-content'] {\\\\n color:green;\\\\n}\\\\n\\\\na {\\\\n content: '';\\\\n}\\\\n\\", \\"\\"]);
exports.push([module.id, \\"._14uFt0lIVKKAlKTTT29IIQ {\\\\n color: \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"v-def\\"] + \\";\\\\n}\\\\n\\\\n._3XDgIzfUIQkaUInpEdo7fN {\\\\n color: blue;\\\\n}\\\\n\\\\n._1wABXM_RabWHj--wsPrhvM {\\\\n display: block;\\\\n}\\\\n\\\\n._1DFEYnAfn9LZyk4fErI86e {\\\\n width: \\" + require(\\"-!../../../src/index.js??ref--4-0!./something.css\\").locals[\\"v-something\\"] + \\";\\\\n}\\\\n\\\\n.Ywv5coVC2RU-pIFhN9O4w {\\\\n color: \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"v-other\\"] + \\";\\\\n}\\\\n\\\\n._1tAbIwITRWAdZZE6wKNk9O {\\\\n prop: \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"v-def\\"] + \\";\\\\n duplicate: \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"v-other\\"] + \\";\\\\n}\\\\n\\\\n.Q3SQ3BwtBwUFLlg6adzOI {\\\\n color: red;\\\\n}\\\\n\\\\n._1n5XhXj4SFnYrwziC3un0d {\\\\n color: yellow;\\\\n}\\\\n\\\\n._3dnFnGkAVAiMA6etF-naHc {\\\\n color: gray;\\\\n}\\\\n\\\\n._1xUePnlnafMQ1cExy3PUWT {\\\\n color: gray;\\\\n}\\\\n\\\\n._26Jdfenl9Xn8HXwb2jipvt {\\\\n color: gainsboro;\\\\n}\\\\n\\\\n._1ya4VhsDkuPhQeVHQydw2Y {\\\\n color: #BF4040;\\\\n}\\\\n\\\\n.sGE1Q_LliVEZU2Q4q9j4K {\\\\n color: black;\\\\n}\\\\n\\\\n@media (min-width: 960px) {\\\\n ._2zSMJ4hQh0FesbZjiKW_ya {\\\\n padding: 0 20px;\\\\n }\\\\n}\\\\n\\\\n.\\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"s-white\\"] + \\" {\\\\n color: white;\\\\n}\\\\n\\\\n@media \\" + require(\\"-!../../../src/index.js??ref--4-0!./values.css\\").locals[\\"m-small\\"] + \\" {\\\\n ._2zSMJ4hQh0FesbZjiKW_ya {\\\\n padding: 20px 20px;\\\\n }\\\\n}\\\\n@value v-comment: /* comment */;\\\\n\\\\n._3qS0_85PLYhk_pNQ69KfSo {\\\\n v-ident: validIdent;\\\\n v-pre-defined-ident: left;\\\\n v-string: 'content';\\\\n v-string-1: '';\\\\n v-url: url(https://www.exammple.com/images/my-background.png);\\\\n v-url-1: url('https://www.exammple.com/images/my-background.png');\\\\n v-url-2: url(\\\\\\"https://www.exammple.com/images/my-background.png\\\\\\");\\\\n v-integer: 100;\\\\n v-integer-1: -100;\\\\n v-integer-2: +100;\\\\n v-number: .60;\\\\n v-number-1: -456.8;\\\\n v-number-2: -3.4e-2;\\\\n v-dimension: 12px;\\\\n v-percentage: 100%;\\\\n v-hex: #fff;\\\\n v-comment: v-comment 10px v-comment;\\\\n v-function: rgb(0,0,0);\\\\n v-unicode-range: U+0025-00FF;\\\\n mutliple: #fff .60 100%;\\\\n}\\\\n\\\\n\\\\na {\\\\n content: 'content';\\\\n}\\\\n\\\\n@supports (content: 'content') {\\\\n a {\\\\n content: 'content';\\\\n }\\\\n}\\\\n\\\\n[class~='content'] {\\\\n color:green;\\\\n}\\\\n\\", \\"\\"]);
// Exports
exports.locals = {
Expand All @@ -6144,8 +6165,24 @@ exports.locals = {
\\"v-primary\\": \\"#BF4040\\",
\\"s-black\\": \\"black-selector\\",
\\"m-large\\": \\"(min-width: 960px)\\",
\\"v-string\\": \\"'my-content'\\",
\\"v-empty-string\\": \\"''\\",
\\"v-ident\\": \\"validIdent\\",
\\"v-pre-defined-ident\\": \\"left\\",
\\"v-string\\": \\"'content'\\",
\\"v-string-1\\": \\"''\\",
\\"v-url\\": \\"url(https://www.exammple.com/images/my-background.png)\\",
\\"v-url-1\\": \\"url('https://www.exammple.com/images/my-background.png')\\",
\\"v-url-2\\": \\"url(\\\\\\"https://www.exammple.com/images/my-background.png\\\\\\")\\",
\\"v-integer\\": \\"100\\",
\\"v-integer-1\\": \\"-100\\",
\\"v-integer-2\\": \\"+100\\",
\\"v-number\\": \\".60\\",
\\"v-number-1\\": \\"-456.8\\",
\\"v-number-2\\": \\"-3.4e-2\\",
\\"v-dimension\\": \\"12px\\",
\\"v-percentage\\": \\"100%\\",
\\"v-hex\\": \\"#fff\\",
\\"v-function\\": \\"rgb(0,0,0)\\",
\\"v-unicode-range\\": \\"U+0025-00FF\\",
\\"ghi\\": \\"_14uFt0lIVKKAlKTTT29IIQ\\",
\\"class\\": \\"_3XDgIzfUIQkaUInpEdo7fN\\",
\\"other\\": \\"_1wABXM_RabWHj--wsPrhvM\\",
Expand All @@ -6159,7 +6196,8 @@ exports.locals = {
\\"alias\\": \\"_26Jdfenl9Xn8HXwb2jipvt \\" + require(\\"-!../../../src/index.js??ref--4-0!aliasesComposes/alias.css\\").locals[\\"imported-alias\\"] + \\"\\",
\\"primary-selector\\": \\"_1ya4VhsDkuPhQeVHQydw2Y\\",
\\"black-selector\\": \\"sGE1Q_LliVEZU2Q4q9j4K\\",
\\"header\\": \\"_2zSMJ4hQh0FesbZjiKW_ya\\"
\\"header\\": \\"_2zSMJ4hQh0FesbZjiKW_ya\\",
\\"foobarbaz\\": \\"_3qS0_85PLYhk_pNQ69KfSo\\"
};"
`;
Expand Down
50 changes: 43 additions & 7 deletions test/fixtures/modules/composes.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,49 @@
}
}

@value v-string: 'my-content';
@value v-ident: validIdent;
@value v-pre-defined-ident: left;
@value v-string: 'content';
@value v-string-1: '';
@value v-url: url(https://www.exammple.com/images/my-background.png);
@value v-url-1: url('https://www.exammple.com/images/my-background.png');
@value v-url-2: url("https://www.exammple.com/images/my-background.png");
@value v-integer: 100;
@value v-integer-1: -100;
@value v-integer-2: +100;
@value v-number: .60;
@value v-number-1: -456.8;
@value v-number-2: -3.4e-2;
@value v-dimension: 12px;
@value v-percentage: 100%;
@value v-hex: #fff;
@value v-comment: /* comment */;
@value v-function: rgb(0,0,0);
@value v-unicode-range: U+0025-00FF;

.foobarbaz {
v-ident: v-ident;
v-pre-defined-ident: v-pre-defined-ident;
v-string: v-string;
v-string-1: v-string-1;
v-url: v-url;
v-url-1: v-url-1;
v-url-2: v-url-2;
v-integer: v-integer;
v-integer-1: v-integer-1;
v-integer-2: v-integer-2;
v-number: v-number;
v-number-1: v-number-1;
v-number-2: v-number-2;
v-dimension: v-dimension;
v-percentage: v-percentage;
v-hex: v-hex;
v-comment: v-comment 10px v-comment;
v-function: v-function;
v-unicode-range: v-unicode-range;
mutliple: v-hex v-number v-percentage;
}


a {
content: v-string;
Expand All @@ -101,9 +143,3 @@ a {
[class~=v-string] {
color:green;
}

@value v-empty-string: '';

a {
content: v-empty-string;
}

0 comments on commit 0672e78

Please sign in to comment.