@@ -10,7 +10,7 @@ describe("source maps", function() {
1010 testWithMap ( "falsy: undefined map doesn't cause an error" , ".class { a: b c d; }" , undefined , [
1111 [ 1 , ".class { a: b c d; }" , "" ]
1212 ] ) ;
13- testWithMap ( "should don't generate sourceMap when `sourceMap: false` and map exist " ,
13+ testWithMap ( "should don't generate sourceMap when `sourceMap: false` and map exists " ,
1414 ".class { a: b c d; }" ,
1515 {
1616 file : 'test.css' ,
@@ -28,7 +28,7 @@ describe("source maps", function() {
2828 sourceMap : false
2929 }
3030 ) ;
31- testWithMap ( "should don't generate sourceMap when `sourceMap: true` and map exist " ,
31+ testWithMap ( "should don't generate sourceMap when `sourceMap: true` and map exists " ,
3232 ".class { a: b c d; }" ,
3333 {
3434 file : 'test.css' ,
@@ -54,6 +54,32 @@ describe("source maps", function() {
5454 sourceMap : true
5555 }
5656 ) ;
57+ testWithMap ( "should don't generate sourceMap when `sourceMap: true` and map exists and string" ,
58+ ".class { a: b c d; }" ,
59+ JSON . stringify ( {
60+ file : 'test.css' ,
61+ mappings : 'AAAA,SAAS,SAAS,EAAE' ,
62+ names : [ ] ,
63+ sourceRoot : '' ,
64+ sources : [ '/folder/test.css' ] ,
65+ sourcesContent : [ '.class { a: b c d; }' ] ,
66+ version : 3
67+ } ) ,
68+ [
69+ [ 1 , ".class { a: b c d; }" , "" , {
70+ file : 'test.css' ,
71+ mappings : 'AAAA,SAAS,SAAS,EAAE' ,
72+ names : [ ] ,
73+ sourceRoot : '' ,
74+ sources : [ '/folder/test.css' ] ,
75+ sourcesContent : [ '.class { a: b c d; }' ] ,
76+ version : 3
77+ } ]
78+ ] ,
79+ {
80+ sourceMap : true
81+ }
82+ ) ;
5783 testMap ( "generate sourceMap (1 loader)" , ".class { a: b c d; }" , undefined , {
5884 loaders : [ { request : "/path/css-loader" } ] ,
5985 resource : "/folder/test.css" ,
0 commit comments