-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: CssSyntaxError in imported file now throws instead of warns
Closes #264
- Loading branch information
Showing
4 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
body { | ||
bar: bar; | ||
qux: qux; | ||
|
||
a { | ||
foo: foo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@import "syntax-error.css"; | ||
|
||
syntax.error { | ||
/* Error isn't here, it's in the imported file */ | ||
color: green; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// builtin tooling | ||
import fs from "fs" | ||
|
||
// external tooling | ||
import test from "ava" | ||
import postcss from "postcss" | ||
|
||
// plugin | ||
import atImport from ".." | ||
|
||
test("SyntaxError in imported file throws", t => { | ||
return postcss(atImport({ path: "test/fixtures/imports" })) | ||
.process(fs.readFileSync("test/fixtures/syntax-error.css", "utf8")) | ||
.then(() => t.fail("should error out")) | ||
.catch(err => t.truthy(err)) | ||
}) |