Skip to content

Commit

Permalink
remove unknown print for rule prelude (#99)
Browse files Browse the repository at this point in the history
not needed anymore since the csstree 3.0.0 upgrade and keeping it in
decreases our coverage
  • Loading branch information
bartveneman authored Sep 20, 2024
1 parent f6a6982 commit 7f9e881
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ export function format(css, { minify = false } = {}) {

if (prelude.type === TYPE_SELECTORLIST) {
buffer = print_selectorlist(prelude)
} else {
// In case parsing the selector list fails we'll print it as-is
buffer = print_unknown(prelude, indent_level)
}

if (block.type === TYPE_BLOCK) {
Expand Down
12 changes: 12 additions & 0 deletions test/selectors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,16 @@ li:nth-child() {}`
assert.equal(actual, expected)
})

test('formats unknown pseudos correctly', () => {
let actual = format(`
::foo-bar,
:unkown-thing(),
:unnowkn(kjsa.asddk,asd) {}
`)
let expected = `::foo-bar,
:unkown-thing(),
:unnowkn(kjsa.asddk,asd) {}`
assert.equal(actual, expected)
})

test.run()

0 comments on commit 7f9e881

Please sign in to comment.