@@ -10,7 +10,7 @@ describe("source maps", function() {
10
10
testWithMap ( "falsy: undefined map doesn't cause an error" , ".class { a: b c d; }" , undefined , [
11
11
[ 1 , ".class { a: b c d; }" , "" ]
12
12
] ) ;
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 " ,
14
14
".class { a: b c d; }" ,
15
15
{
16
16
file : 'test.css' ,
@@ -28,7 +28,7 @@ describe("source maps", function() {
28
28
sourceMap : false
29
29
}
30
30
) ;
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 " ,
32
32
".class { a: b c d; }" ,
33
33
{
34
34
file : 'test.css' ,
@@ -54,6 +54,32 @@ describe("source maps", function() {
54
54
sourceMap : true
55
55
}
56
56
) ;
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
+ ) ;
57
83
testMap ( "generate sourceMap (1 loader)" , ".class { a: b c d; }" , undefined , {
58
84
loaders : [ { request : "/path/css-loader" } ] ,
59
85
resource : "/folder/test.css" ,
0 commit comments