@@ -13,7 +13,7 @@ describe('scss split creation', function () {
1313 ` ;
1414 const parsed = parse ( sassString ) ;
1515
16- parsed . then ( x => {
16+ return parsed . then ( x => {
1717 expect ( x . splits [ 0 ] ) . to . equal ( 'h1 { color: brand-color(c4); }' ) ;
1818 } ) ;
1919 } ) ;
@@ -30,7 +30,7 @@ describe('scss split creation', function () {
3030 ` ;
3131 const parsed = parse ( sassString ) ;
3232
33- parsed . then ( x => {
33+ return parsed . then ( x => {
3434 expect ( x . splits [ 1 ] )
3535 . to . equal ( '@include brand(foo) {\n margin: 0;\n }' ) ;
3636 } ) ;
@@ -48,7 +48,7 @@ describe('scss split creation', function () {
4848 ` ;
4949 const parsed = parse ( sassString ) ;
5050
51- parsed . then ( x => {
51+ return parsed . then ( x => {
5252 expect ( x . splits [ 0 ] ) . to . equal ( 'div h2 { color: brand-color(c4); }' ) ;
5353 } ) ;
5454 } ) ;
6868}` ;
6969 const parsed = parse ( sassString ) ;
7070
71- parsed . then ( x => {
71+ return parsed . then ( x => {
7272 expect ( x . splits [ 0 ] ) . to . equal ( '@media (min-width: 40em) {' ) ;
7373 expect ( x . splits [ 1 ] ) . to . equal ( '@include brand(foo) {\n div span span {\n color: red\n }\n }' ) ;
7474 } ) ;
8888}` ;
8989 const parsed = parse ( sassString ) ;
9090
91- parsed . then ( x => {
91+ return parsed . then ( x => {
9292 expect ( x . splits [ 0 ] ) . to . equal ( '@media (min-width: 40em) {' ) ;
9393 expect ( x . splits [ 1 ] ) . to . equal ( 'div span span { color: brand-color(c4); }' ) ;
9494 } ) ;
@@ -106,8 +106,29 @@ body {
106106` ;
107107 const parsed = parse ( sassString ) ;
108108
109- parsed . then ( x => {
110- expect ( x . splits [ 1 ] ) . to . equal ( '@include brand(mozo) {\n @include brand-text();\n }' ) ;
109+ return parsed . then ( x => {
110+ expect ( x . splits [ 1 ] ) . to . equal ( '@include brand(foo) {\n @include brand-text();\n }' ) ;
111+ } ) ;
112+ } ) ;
113+
114+ it ( 'does not orphan one-line includes' , function ( ) {
115+ const sassString = `
116+ .foo {
117+ @media (min-width: 40em) {
118+ @include clearfix;
119+ }
120+ }
121+ ` ;
122+ const parsed = parse ( sassString ) ;
123+
124+ return parsed . then ( x => {
125+ expect ( x . css ) . to . equal ( `
126+ @media (min-width: 40em) {
127+ .foo {
128+ @include clearfix
129+ }
130+ }
131+ ` ) ;
111132 } ) ;
112133 } ) ;
113134} ) ;
0 commit comments