Skip to content
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

test: add test with escaped characters #493

Merged
merged 1 commit into from
Apr 18, 2017
Merged
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
33 changes: 22 additions & 11 deletions test/simpleTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,29 @@ describe("simple", function() {
test("simple2", ".class { a: b c d; }\n.two {}", [
[1, ".class { a: b c d; }\n.two {}", ""]
]);
test("escape characters (uppercase)", ".class { content: \"\\F10C\" }", [
[1, ".class { content: \"\\F10C\" }", ""]
]);
// Need uncomment after resolve https://github.com/css-modules/postcss-modules-local-by-default/issues/108
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about these tbh, maybe better keep a note and add them when it is resolved :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-ciniawsky i think best note is not in code, some issue can resolve in a long time 😭 Be good merge this as is and if some submit about problem related to this add link to issue in other repo maybe it is help solve the problem faster

/*test("escape characters (lowercase)", ".class { content: \"\\f10C\" }", [
[1, ".class { content: \"\\f10C\" }", ""]
]);*/
// Need uncomment after resolve https://github.com/mathiasbynens/cssesc/issues/10
/*test("escape characters (two)", ".class { content: \"\\F10C \\F10D\" }", [
[1, ".class { content: \"\\F10C \\F10D\" }", ""]
]);*/
testMinimize("minimized simple", ".class { a: b c d; }", [
[1, ".class{a:b c d}", ""]
]);
testError("error formatting", ".some {\n invalid css;\n}", function(err) {
assert.equal(err.message, [
'Unknown word (2:2)',
'',
' 1 | .some {',
'> 2 | invalid css;',
' | ^',
' 3 | }',
'',
].join('\n'));
});
testError("error formatting", ".some {\n invalid css;\n}", function(err) {
assert.equal(err.message, [
'Unknown word (2:2)',
'',
' 1 | .some {',
'> 2 | invalid css;',
' | ^',
' 3 | }',
'',
].join('\n'));
});
});