Skip to content

Commit

Permalink
test: add test for escaped characters (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored and michael-ciniawsky committed Apr 18, 2017
1 parent bff9c7f commit 6ee2fc6
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions test/simpleTest.js
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
/*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'));
});
});

0 comments on commit 6ee2fc6

Please sign in to comment.