Skip to content

Commit 405b015

Browse files
committed
Add failing test for @charset
Refs #436
1 parent fee216e commit 405b015

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/import.js

+11
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ test("should not fail with absolute and local import", t => {
4646
.then(result => t.is(result.css, "@import url('http://');\nfoo{}"))
4747
})
4848

49+
test("should keep @charset first", t => {
50+
const base = "@charset 'utf-8';\n@import url(http://)"
51+
return postcss()
52+
.use(atImport())
53+
.process(base, { from: undefined })
54+
.then(result => {
55+
t.is(result.warnings().length, 0)
56+
t.is(result.css, base)
57+
})
58+
})
59+
4960
test("should error when file not found", t => {
5061
t.plan(1)
5162
const file = "test/fixtures/imports/import-missing.css"

0 commit comments

Comments
 (0)