Skip to content

Commit

Permalink
Add failing test for @charset
Browse files Browse the repository at this point in the history
Refs #436
  • Loading branch information
RyanZim committed Nov 4, 2020
1 parent fee216e commit 405b015
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/import.js
Expand Up @@ -46,6 +46,17 @@ test("should not fail with absolute and local import", t => {
.then(result => t.is(result.css, "@import url('http://');\nfoo{}"))
})

test("should keep @charset first", t => {
const base = "@charset 'utf-8';\n@import url(http://)"
return postcss()
.use(atImport())
.process(base, { from: undefined })
.then(result => {
t.is(result.warnings().length, 0)
t.is(result.css, base)
})
})

test("should error when file not found", t => {
t.plan(1)
const file = "test/fixtures/imports/import-missing.css"
Expand Down

0 comments on commit 405b015

Please sign in to comment.