Skip to content

Commit 6b95c65

Browse files
authored
add third level dependencies test (#134)
1 parent e9bda0f commit 6b95c65

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

index.test.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ it('works with other visitors', () => {
218218
}
219219
}
220220
mixinPlugin.postcss = true
221-
let out = postcss([plugin, mixinPlugin]).process(css, { from: undefined }).css
221+
let out = postcss([plugin, mixinPlugin]).process(css, {
222+
from: undefined
223+
}).css
222224
expect(out).toEqual('a b{color:red}a .in .deep{color:blue}')
223225
})
224226

@@ -235,7 +237,9 @@ it('works with other visitors #2', () => {
235237
}
236238
}
237239
mixinPlugin.postcss = true
238-
let out = postcss([plugin, mixinPlugin]).process(css, { from: undefined }).css
240+
let out = postcss([plugin, mixinPlugin]).process(css, {
241+
from: undefined
242+
}).css
239243
expect(out).toEqual('a .in .deep {color:blue} a b {color:red}')
240244
})
241245

@@ -252,3 +256,14 @@ it('shows clear errors on other errors', () => {
252256
css = postcss([plugin]).process(css, { from: undefined }).css
253257
}).toThrow(':2:3: Unexpected')
254258
})
259+
260+
it('third level dependencies', () => {
261+
run(
262+
'.text {&:hover{border-color: red;&:before{color: red;}}}',
263+
'.text:hover{border-color: red;}.text:hover:before{color: red;}'
264+
)
265+
})
266+
267+
it('third level dependencies #2', () => {
268+
run('.selector{:global{h2{color:pink}}}', '.selector :global h2{color:pink}')
269+
})

0 commit comments

Comments
 (0)