@@ -844,6 +844,30 @@ const tests = [
844844 input : ":global(.a:not(:global .b, :global .c)) {}" ,
845845 error : / A : g l o b a l i s n o t a l l o w e d i n s i d e o f a : g l o b a l / ,
846846 } ,
847+ {
848+ name : "consider & statements as pure" ,
849+ input : ".foo { &:hover { a_value: some-value; } }" ,
850+ options : { mode : "pure" } ,
851+ expected : ":local(.foo) { &:hover { a_value: some-value; } }" ,
852+ } ,
853+ {
854+ name : "consider selector & statements as pure" ,
855+ input : ".foo { html &:hover { a_value: some-value; } }" ,
856+ options : { mode : "pure" } ,
857+ expected : ":local(.foo) { html &:hover { a_value: some-value; } }" ,
858+ } ,
859+ {
860+ name : "consider selector & statements as pure" ,
861+ input : ".foo { &:global(.bar) { a_value: some-value; } }" ,
862+ options : { mode : "pure" } ,
863+ expected : ":local(.foo) { &.bar { a_value: some-value; } }" ,
864+ } ,
865+ {
866+ name : "throw on nested & selectors without a local selector" ,
867+ input : ":global(.foo) { &:hover { a_value: some-value; } }" ,
868+ options : { mode : "pure" } ,
869+ error : / i s n o t p u r e / ,
870+ } ,
847871 /*
848872 Bug in postcss-selector-parser
849873 {
0 commit comments