Skip to content

Commit fe94ebc

Browse files
test: icss reserved keywords (#839)
1 parent 9eaba66 commit fe94ebc

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed

test/__snapshots__/icss.test.js.snap

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,28 @@ Array [
9797

9898
exports[`ICSS case export: warnings 1`] = `Array []`;
9999

100+
exports[`ICSS case export-reserved-keywords: errors 1`] = `Array []`;
101+
102+
exports[`ICSS case export-reserved-keywords: locals 1`] = `
103+
Object {
104+
"constructor": "constructor",
105+
"toString": "toString",
106+
}
107+
`;
108+
109+
exports[`ICSS case export-reserved-keywords: module (evaluated) 1`] = `
110+
Array [
111+
Array [
112+
1,
113+
"
114+
",
115+
"",
116+
],
117+
]
118+
`;
119+
120+
exports[`ICSS case export-reserved-keywords: warnings 1`] = `Array []`;
121+
100122
exports[`ICSS case import: errors 1`] = `Array []`;
101123

102124
exports[`ICSS case import: locals 1`] = `
@@ -126,6 +148,37 @@ Array [
126148

127149
exports[`ICSS case import: warnings 1`] = `Array []`;
128150

151+
exports[`ICSS case import-reserved-keywords: errors 1`] = `Array []`;
152+
153+
exports[`ICSS case import-reserved-keywords: locals 1`] = `
154+
Object {
155+
"primary-color": "red",
156+
"secondary-color": "block",
157+
}
158+
`;
159+
160+
exports[`ICSS case import-reserved-keywords: module (evaluated) 1`] = `
161+
Array [
162+
Array [
163+
2,
164+
"
165+
",
166+
"",
167+
],
168+
Array [
169+
1,
170+
".className {
171+
color: red;
172+
display: block;
173+
}
174+
",
175+
"",
176+
],
177+
]
178+
`;
179+
180+
exports[`ICSS case import-reserved-keywords: warnings 1`] = `Array []`;
181+
129182
exports[`ICSS case multiple-export: errors 1`] = `Array []`;
130183

131184
exports[`ICSS case multiple-export: locals 1`] = `
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:export {
2+
constructor: constructor;
3+
toString: toString;
4+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
:import("./vars.css") {
2+
constructor: primary-color;
3+
toString: secondary-color;
4+
}
5+
6+
.className {
7+
color: constructor;
8+
display: toString;
9+
}
10+
11+
:export {
12+
primary-color: constructor;
13+
secondary-color: toString;
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:export {
2+
primary-color: red;
3+
secondary-color: block;
4+
}

test/helpers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function evaluated(output, modules, moduleId = 1) {
3333
const importedPaths = [
3434
'postcss-present-env',
3535
'icss/tests-cases/import',
36+
'icss/tests-cases/import-reserved-keywords',
3637
'import',
3738
'import/node_modules',
3839
'url',

0 commit comments

Comments
 (0)