From 9ccc3fa7918cd3cf9e7fa5ab198bb19d5d11e2c1 Mon Sep 17 00:00:00 2001 From: Igor Pnev Date: Sat, 12 Jun 2021 17:44:59 +0300 Subject: [PATCH] add third level dependencies test --- index.test.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/index.test.js b/index.test.js index a24ec62..6c4eccb 100644 --- a/index.test.js +++ b/index.test.js @@ -218,7 +218,9 @@ it('works with other visitors', () => { } } mixinPlugin.postcss = true - let out = postcss([plugin, mixinPlugin]).process(css, { from: undefined }).css + let out = postcss([plugin, mixinPlugin]).process(css, { + from: undefined + }).css expect(out).toEqual('a b{color:red}a .in .deep{color:blue}') }) @@ -235,7 +237,9 @@ it('works with other visitors #2', () => { } } mixinPlugin.postcss = true - let out = postcss([plugin, mixinPlugin]).process(css, { from: undefined }).css + let out = postcss([plugin, mixinPlugin]).process(css, { + from: undefined + }).css expect(out).toEqual('a .in .deep {color:blue} a b {color:red}') }) @@ -252,3 +256,14 @@ it('shows clear errors on other errors', () => { css = postcss([plugin]).process(css, { from: undefined }).css }).toThrow(':2:3: Unexpected') }) + +it('third level dependencies', () => { + run( + '.text {&:hover{border-color: red;&:before{color: red;}}}', + '.text:hover{border-color: red;}.text:hover:before{color: red;}' + ) +}) + +it('third level dependencies #2', () => { + run('.selector{:global{h2{color:pink}}}', '.selector :global h2{color:pink}') +})