@@ -21,46 +21,62 @@ describe('api', () => {
2121
2222 it ( 'should toString a single module' , ( ) => {
2323 const m = api ( ) ;
24+
2425 m . push ( [ 1 , 'body { a: 1; }' , '' ] ) ;
26+
2527 expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
2628 } ) ;
29+
2730 it ( 'should toString multiple modules' , ( ) => {
2831 const m = api ( ) ;
32+
2933 m . push ( [ 2 , 'body { b: 2; }' , '' ] ) ;
3034 m . push ( [ 1 , 'body { a: 1; }' , '' ] ) ;
35+
3136 expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
3237 } ) ;
38+
3339 it ( 'should toString with media query' , ( ) => {
3440 const m = api ( ) ;
41+
3542 m . push ( [ 1 , 'body { a: 1; }' , 'screen' ] ) ;
43+
3644 expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
3745 } ) ;
46+
3847 it ( 'should import modules' , ( ) => {
3948 const m = api ( ) ;
4049 const m1 = [ 1 , 'body { a: 1; }' , 'screen' ] ;
4150 const m2 = [ 2 , 'body { b: 2; }' , '' ] ;
4251 const m3 = [ 3 , 'body { c: 3; }' , '' ] ;
4352 const m4 = [ 4 , 'body { d: 4; }' , '' ] ;
53+
4454 m . i ( [ m2 , m3 ] , '' ) ;
4555 m . i ( [ m2 ] , '' ) ;
4656 m . i ( [ m2 , m4 ] , 'print' ) ;
4757 m . push ( m1 ) ;
58+
4859 expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
4960 } ) ;
61+
5062 it ( 'should import named modules' , ( ) => {
5163 const m = api ( ) ;
5264 const m1 = [ './module1' , 'body { a: 1; }' , 'screen' ] ;
5365 const m2 = [ './module2' , 'body { b: 2; }' , '' ] ;
5466 const m3 = [ './module3' , 'body { c: 3; }' , '' ] ;
5567 const m4 = [ './module4' , 'body { d: 4; }' , '' ] ;
68+
5669 m . i ( [ m2 , m3 ] , '' ) ;
5770 m . i ( [ m2 ] , '' ) ;
5871 m . i ( [ m2 , m4 ] , 'print' ) ;
5972 m . push ( m1 ) ;
73+
6074 expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
6175 } ) ;
76+
6277 it ( 'should toString with source mapping' , ( ) => {
6378 const m = api ( true ) ;
79+
6480 m . push ( [
6581 1 ,
6682 'body { a: 1; }' ,
@@ -72,11 +88,15 @@ describe('api', () => {
7288 sourceRoot : 'webpack://' ,
7389 } ,
7490 ] ) ;
91+
7592 expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
7693 } ) ;
94+
7795 it ( 'should toString without source mapping if btoa not avalibale' , ( ) => {
7896 global . btoa = null ;
97+
7998 const m = api ( true ) ;
99+
80100 m . push ( [
81101 1 ,
82102 'body { a: 1; }' ,
@@ -88,6 +108,7 @@ describe('api', () => {
88108 sourceRoot : 'webpack://' ,
89109 } ,
90110 ] ) ;
111+
91112 expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
92113 } ) ;
93114} ) ;
0 commit comments