Skip to content

Commit

Permalink
test: icss reserved keywords (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Dec 3, 2018
1 parent 9eaba66 commit fe94ebc
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
53 changes: 53 additions & 0 deletions test/__snapshots__/icss.test.js.snap
Expand Up @@ -97,6 +97,28 @@ Array [

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

exports[`ICSS case export-reserved-keywords: errors 1`] = `Array []`;

exports[`ICSS case export-reserved-keywords: locals 1`] = `
Object {
"constructor": "constructor",
"toString": "toString",
}
`;

exports[`ICSS case export-reserved-keywords: module (evaluated) 1`] = `
Array [
Array [
1,
"
",
"",
],
]
`;

exports[`ICSS case export-reserved-keywords: warnings 1`] = `Array []`;

exports[`ICSS case import: errors 1`] = `Array []`;

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

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

exports[`ICSS case import-reserved-keywords: errors 1`] = `Array []`;

exports[`ICSS case import-reserved-keywords: locals 1`] = `
Object {
"primary-color": "red",
"secondary-color": "block",
}
`;

exports[`ICSS case import-reserved-keywords: module (evaluated) 1`] = `
Array [
Array [
2,
"
",
"",
],
Array [
1,
".className {
color: red;
display: block;
}
",
"",
],
]
`;

exports[`ICSS case import-reserved-keywords: warnings 1`] = `Array []`;

exports[`ICSS case multiple-export: errors 1`] = `Array []`;

exports[`ICSS case multiple-export: locals 1`] = `
Expand Down
@@ -0,0 +1,4 @@
:export {
constructor: constructor;
toString: toString;
}
14 changes: 14 additions & 0 deletions test/fixtures/icss/tests-cases/import-reserved-keywords/source.css
@@ -0,0 +1,14 @@
:import("./vars.css") {
constructor: primary-color;
toString: secondary-color;
}

.className {
color: constructor;
display: toString;
}

:export {
primary-color: constructor;
secondary-color: toString;
}
@@ -0,0 +1,4 @@
:export {
primary-color: red;
secondary-color: block;
}
1 change: 1 addition & 0 deletions test/helpers.js
Expand Up @@ -33,6 +33,7 @@ function evaluated(output, modules, moduleId = 1) {
const importedPaths = [
'postcss-present-env',
'icss/tests-cases/import',
'icss/tests-cases/import-reserved-keywords',
'import',
'import/node_modules',
'url',
Expand Down

0 comments on commit fe94ebc

Please sign in to comment.