@@ -6,11 +6,19 @@ import {stringify} from '../../../main/stringify'
66describe ( 'main > parse' , function ( ) {
77 const css = `
88 @import 'module.js';
9+ @font-face;
910 @font-face {
1011
1112 }
1213 @media(min-width: 500px) {
1314
15+ }
16+ @font-face {
17+ color: #0f0;
18+ }
19+ @media(min-width: 500px) {
20+ color: #0ff;
21+ font-size: 1px
1422 }
1523 :global(.x::placeholder) {
1624 color: blue !important;
@@ -25,8 +33,14 @@ describe('main > parse', function () {
2533 const js = [
2634 "@import 'module.js'" ,
2735 '@font-face' ,
28- '@media (min-width: 500px)' ,
2936 {
37+ '@font-face' : {
38+ color : '#0f0'
39+ } ,
40+ '@media (min-width: 500px)' : {
41+ color : '#0ff' ,
42+ 'font-size' : '1px'
43+ } ,
3044 ':global(.x::placeholder)' : {
3145 color : 'blue !important' ,
3246 background : '-moz-linear-gradient(top, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%)' ,
@@ -40,15 +54,36 @@ describe('main > parse', function () {
4054 }
4155 ]
4256
57+ const postProcessCss = `
58+ @import 'module.js';
59+ @font-face;
60+ @font-face {
61+ color: #0f0
62+ }
63+ @media (min-width: 500px) {
64+ color: #0ff;
65+ font-size: 1px
66+ }
67+ :global(.x::placeholder) {
68+ color: blue !important;
69+ background: -moz-linear-gradient(top, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%);
70+ .y {
71+ /* Comment */
72+ content: "text"
73+ }
74+ }
75+ `
76+
4377 it ( 'parse' , function ( ) {
4478 const parsedPostcss = postcssParse ( css )
4579
4680 const parsedJs = parse ( parsedPostcss )
4781
4882 assert . deepStrictEqual ( parsedJs , js )
83+ assert . strictEqual ( JSON . stringify ( parsedJs ) , JSON . stringify ( js ) )
4984 } )
5085
51- xit ( 'stringify' , function ( ) {
86+ it ( 'stringify' , function ( ) {
5287 const stringifyPostcss = stringify ( js )
5388
5489 const builder = [ ]
@@ -57,6 +92,6 @@ describe('main > parse', function () {
5792 } )
5893 const stringifyCss = builder . join ( '' )
5994
60- assert . strictEqual ( stringifyCss , css )
95+ assert . strictEqual ( stringifyCss , postProcessCss )
6196 } )
6297} )
0 commit comments