Skip to content

Commit

Permalink
tests: Add failing tests for root-level & {} blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
maranomynet committed Mar 31, 2023
1 parent 648841d commit c5516b1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions index.test.js
Expand Up @@ -782,4 +782,25 @@ test('selector-less curly-brace blocks are removed from output', () => {
)
})

test('root-level `&` is removed from output', () => {
run(
'a {color:white} & { b {color:red;} c & { & { color:green; } } & d {color:blue;} }',
'a {color:white} b {color:red;} c {color:green;} d {color:blue;}'
)
})

test('root level `&` inside @media is removed', () => {
run(
'@media screen { & { a {color:red;} b & {color:green;} } }',
'@media screen { a {color:red;} b {color:green;} }'
)
})

test('root level `&` with @media inside is removed', () => {
run(
'& { @media screen { a {color:red;} b & {color:green;} } }',
'@media screen { a {color:red;} b {color:green;} }'
)
})

test.run()

0 comments on commit c5516b1

Please sign in to comment.