Skip to content

test: icss reserved keywords #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions test/__snapshots__/icss.test.js.snap
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:export {
primary-color: red;
secondary-color: block;
}
1 change: 1 addition & 0 deletions test/helpers.js
Original file line number Diff line number Diff line change
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