From a8383177d030d6367be3658921e83c4dc2eb8212 Mon Sep 17 00:00:00 2001 From: Evilebot Tnawi Date: Thu, 20 Aug 2020 20:21:06 +0300 Subject: [PATCH] test: source maps (#881) --- .../sourceMap-options.test.js.snap | 1902 +++++++++++++++++ test/sourceMap-options.test.js | 47 +- 2 files changed, 1929 insertions(+), 20 deletions(-) diff --git a/test/__snapshots__/sourceMap-options.test.js.snap b/test/__snapshots__/sourceMap-options.test.js.snap index 97bb778d..8e96d575 100644 --- a/test/__snapshots__/sourceMap-options.test.js.snap +++ b/test/__snapshots__/sourceMap-options.test.js.snap @@ -1,97 +1,1999 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (dart-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.message, .warning, .error, .success { + border: 1px solid #ccc; + padding: 10px; + color: #333; +} + +.success { + border-color: green; +} + +.error { + border-color: red; +} + +.warning { + border-color: yellow; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (dart-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (dart-sass) (sass): source map 1`] = ` +Object { + "mappings": ";AAMA;EACE;EACA,OALc;;;AAQd;EACE;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;EACA;;;AAQJ;EALE,uBAMe;EALf,oBAKe;EAJf,mBAIe;EAHf,eAGe;;;AAEjB;EACE;EACA;EACA;;;AAEF;EAEE;;;AAEF;EAEE;;;AAEF;EAEE;;;AAGA;EACE,SAhDY;;;AAmDd;EACE,SCxDc", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/sass/language.sass", + "test/sass/another/variables.sass", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\" + +$font-stack: Helvetica, sans-serif +$primary-color: #333 +$pi: '\\\\e0C6' + +body + font: 100% $font-stack + color: $primary-color + +nav + ul + margin: 0 + padding: 0 + list-style: none + + li + display: inline-block + + a + display: block + padding: 6px 12px + text-decoration: none + +=border-radius($radius) + -webkit-border-radius: $radius + -moz-border-radius: $radius + -ms-border-radius: $radius + border-radius: $radius + +.box + +border-radius(10px) + +.message + border: 1px solid #ccc + padding: 10px + color: #333 + +.success + @extend .message + border-color: green + +.error + @extend .message + border-color: red + +.warning + @extend .message + border-color: yellow + +.foo + &:before + content: $pi + +.bar + &:before + content: $n-ary-summation + +", + "$n-ary-summation: '\\\\2211' +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (dart-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (dart-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (dart-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (dart-sass) (scss): source map 1`] = ` +Object { + "mappings": ";AAMA;EACE;EACA,OALc;;;AASd;EACE;EACA;EACA;;AAGF;EAAK;;AAEL;EACE;EACA;EACA;;;AAWJ;EANE,uBAM4B;EALzB,oBAKyB;EAJxB,mBAIwB;EAHpB,eAGoB;;;AAG5B;EACE,SAlCY;;;AAuCd;EACE,SC5Cc", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/scss/language.scss", + "test/scss/another/_variables.scss", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\"; + +$font-stack: Helvetica, sans-serif; +$primary-color: #333; +$pi: '\\\\e0C6'; + +body { + font: 100% $font-stack; + color: $primary-color; +} + +nav { + ul { + margin: 0; + padding: 0; + list-style: none; + } + + li { display: inline-block; } + + a { + display: block; + padding: 6px 12px; + text-decoration: none; + } +} + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + border-radius: $radius; +} + +.box { @include border-radius(10px); } + +.foo { + &:before { + content: $pi; + } +} + +.bar { + &:before { + content: $n-ary-summation; + } +} +", + "$n-ary-summation: '\\\\2211' +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (dart-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (node-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.message, .success, .error, .warning { + border: 1px solid #ccc; + padding: 10px; + color: #333; } + +.success { + border-color: green; } + +.error { + border-color: red; } + +.warning { + border-color: yellow; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (node-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (node-sass) (sass): source map 1`] = ` +Object { + "mappings": ";AAMA,AAAA,IAAI,CAAC;EACH,IAAI,EAAE,IAAI,CALI,SAAS,EAAE,UAAU;EAMnC,KAAK,EALS,IAAI,GAKM;;AAE1B,AACE,GADC,CACD,EAAE,CAAC;EACD,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,IAAI,GAAG;;AAJvB,AAME,GANC,CAMD,EAAE,CAAC;EACD,OAAO,EAAE,YAAY,GAAG;;AAP5B,AASE,GATC,CASD,CAAC,CAAC;EACA,OAAO,EAAE,KAAK;EACd,OAAO,EAAE,QAAQ;EACjB,eAAe,EAAE,IAAI,GAAG;;AAQ5B,AAAA,IAAI,CAAC;EALH,qBAAqB,EAME,IAAI;EAL3B,kBAAkB,EAKK,IAAI;EAJ3B,iBAAiB,EAIM,IAAI;EAH3B,aAAa,EAGU,IAAI,GAAI;;AAEjC,AAAA,QAAQ,EAKR,QAAQ,EAIR,MAAM,EAIN,QAAQ,CAbC;EACP,MAAM,EAAE,cAAc;EACtB,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,IAAI,GAAG;;AAEhB,AAAA,QAAQ,CAAC;EAEP,YAAY,EAAE,KAAK,GAAG;;AAExB,AAAA,MAAM,CAAC;EAEL,YAAY,EAAE,GAAG,GAAG;;AAEtB,AAAA,QAAQ,CAAC;EAEP,YAAY,EAAE,MAAM,GAAG;;AAEzB,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,EAhDK,IAAO,GAgDJ;;AAEnB,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,ECxDO,IAAO,GDwDO", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/sass/language.sass", + "test/sass/another/variables.sass", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\"; + +$font-stack: Helvetica, sans-serif; +$primary-color: #333; +$pi: '\\\\e0C6'; + +body { + font: 100% $font-stack; + color: $primary-color; } + +nav { + ul { + margin: 0; + padding: 0; + list-style: none; } + + li { + display: inline-block; } + + a { + display: block; + padding: 6px 12px; + text-decoration: none; } } + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + border-radius: $radius; } + +.box { + @include border-radius(10px); } + +.message { + border: 1px solid #ccc; + padding: 10px; + color: #333; } + +.success { + @extend .message; + border-color: green; } + +.error { + @extend .message; + border-color: red; } + +.warning { + @extend .message; + border-color: yellow; } + +.foo { + &:before { + content: $pi; } } + +.bar { + &:before { + content: $n-ary-summation; } } + +", + "$n-ary-summation: '\\\\2211'; +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (node-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (node-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (node-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (node-sass) (scss): source map 1`] = ` +Object { + "mappings": ";AAMA,AAAA,IAAI,CAAC;EACH,IAAI,EAAE,IAAI,CALI,SAAS,EAAE,UAAU;EAMnC,KAAK,EALS,IAAI,GAMnB;;AAED,AACE,GADC,CACD,EAAE,CAAC;EACD,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,IAAI,GACjB;;AALH,AAOE,GAPC,CAOD,EAAE,CAAC;EAAE,OAAO,EAAE,YAAY,GAAI;;AAPhC,AASE,GATC,CASD,CAAC,CAAC;EACA,OAAO,EAAE,KAAK;EACd,OAAO,EAAE,QAAQ;EACjB,eAAe,EAAE,IAAI,GACtB;;AAUH,AAAA,IAAI,CAAC;EANH,qBAAqB,EAMO,IAAI;EAL7B,kBAAkB,EAKO,IAAI;EAJ5B,iBAAiB,EAIO,IAAI;EAHxB,aAAa,EAGO,IAAI,GAAK;;AAEvC,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,EAlCK,IAAO,GAmCpB;;AAGH,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,EC5CO,IAAO,GD6CtB", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/scss/language.scss", + "test/scss/another/_variables.scss", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\"; + +$font-stack: Helvetica, sans-serif; +$primary-color: #333; +$pi: '\\\\e0C6'; + +body { + font: 100% $font-stack; + color: $primary-color; +} + +nav { + ul { + margin: 0; + padding: 0; + list-style: none; + } + + li { display: inline-block; } + + a { + display: block; + padding: 6px 12px; + text-decoration: none; + } +} + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + border-radius: $radius; +} + +.box { @include border-radius(10px); } + +.foo { + &:before { + content: $pi; + } +} + +.bar { + &:before { + content: $n-ary-summation; + } +} +", + "$n-ary-summation: '\\\\2211' +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "false" value (node-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (dart-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.message, .warning, .error, .success { + border: 1px solid #ccc; + padding: 10px; + color: #333; +} + +.success { + border-color: green; +} + +.error { + border-color: red; +} + +.warning { + border-color: yellow; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (dart-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (dart-sass) (sass): source map 1`] = ` +Object { + "mappings": ";AAMA;EACE;EACA,OALc;;;AAQd;EACE;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;EACA;;;AAQJ;EALE,uBAMe;EALf,oBAKe;EAJf,mBAIe;EAHf,eAGe;;;AAEjB;EACE;EACA;EACA;;;AAEF;EAEE;;;AAEF;EAEE;;;AAEF;EAEE;;;AAGA;EACE,SAhDY;;;AAmDd;EACE,SCxDc", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/sass/language.sass", + "test/sass/another/variables.sass", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\" + +$font-stack: Helvetica, sans-serif +$primary-color: #333 +$pi: '\\\\e0C6' + +body + font: 100% $font-stack + color: $primary-color + +nav + ul + margin: 0 + padding: 0 + list-style: none + + li + display: inline-block + + a + display: block + padding: 6px 12px + text-decoration: none + +=border-radius($radius) + -webkit-border-radius: $radius + -moz-border-radius: $radius + -ms-border-radius: $radius + border-radius: $radius + +.box + +border-radius(10px) + +.message + border: 1px solid #ccc + padding: 10px + color: #333 + +.success + @extend .message + border-color: green + +.error + @extend .message + border-color: red + +.warning + @extend .message + border-color: yellow + +.foo + &:before + content: $pi + +.bar + &:before + content: $n-ary-summation + +", + "$n-ary-summation: '\\\\2211' +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (dart-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (dart-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (dart-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (dart-sass) (scss): source map 1`] = ` +Object { + "mappings": ";AAMA;EACE;EACA,OALc;;;AASd;EACE;EACA;EACA;;AAGF;EAAK;;AAEL;EACE;EACA;EACA;;;AAWJ;EANE,uBAM4B;EALzB,oBAKyB;EAJxB,mBAIwB;EAHpB,eAGoB;;;AAG5B;EACE,SAlCY;;;AAuCd;EACE,SC5Cc", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/scss/language.scss", + "test/scss/another/_variables.scss", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\"; + +$font-stack: Helvetica, sans-serif; +$primary-color: #333; +$pi: '\\\\e0C6'; + +body { + font: 100% $font-stack; + color: $primary-color; +} + +nav { + ul { + margin: 0; + padding: 0; + list-style: none; + } + + li { display: inline-block; } + + a { + display: block; + padding: 6px 12px; + text-decoration: none; + } +} + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + border-radius: $radius; +} + +.box { @include border-radius(10px); } + +.foo { + &:before { + content: $pi; + } +} + +.bar { + &:before { + content: $n-ary-summation; + } +} +", + "$n-ary-summation: '\\\\2211' +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (dart-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (node-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.message, .success, .error, .warning { + border: 1px solid #ccc; + padding: 10px; + color: #333; } + +.success { + border-color: green; } + +.error { + border-color: red; } + +.warning { + border-color: yellow; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (node-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (node-sass) (sass): source map 1`] = ` +Object { + "mappings": ";AAMA,AAAA,IAAI,CAAC;EACH,IAAI,EAAE,IAAI,CALI,SAAS,EAAE,UAAU;EAMnC,KAAK,EALS,IAAI,GAKM;;AAE1B,AACE,GADC,CACD,EAAE,CAAC;EACD,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,IAAI,GAAG;;AAJvB,AAME,GANC,CAMD,EAAE,CAAC;EACD,OAAO,EAAE,YAAY,GAAG;;AAP5B,AASE,GATC,CASD,CAAC,CAAC;EACA,OAAO,EAAE,KAAK;EACd,OAAO,EAAE,QAAQ;EACjB,eAAe,EAAE,IAAI,GAAG;;AAQ5B,AAAA,IAAI,CAAC;EALH,qBAAqB,EAME,IAAI;EAL3B,kBAAkB,EAKK,IAAI;EAJ3B,iBAAiB,EAIM,IAAI;EAH3B,aAAa,EAGU,IAAI,GAAI;;AAEjC,AAAA,QAAQ,EAKR,QAAQ,EAIR,MAAM,EAIN,QAAQ,CAbC;EACP,MAAM,EAAE,cAAc;EACtB,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,IAAI,GAAG;;AAEhB,AAAA,QAAQ,CAAC;EAEP,YAAY,EAAE,KAAK,GAAG;;AAExB,AAAA,MAAM,CAAC;EAEL,YAAY,EAAE,GAAG,GAAG;;AAEtB,AAAA,QAAQ,CAAC;EAEP,YAAY,EAAE,MAAM,GAAG;;AAEzB,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,EAhDK,IAAO,GAgDJ;;AAEnB,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,ECxDO,IAAO,GDwDO", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/sass/language.sass", + "test/sass/another/variables.sass", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\"; + +$font-stack: Helvetica, sans-serif; +$primary-color: #333; +$pi: '\\\\e0C6'; + +body { + font: 100% $font-stack; + color: $primary-color; } + +nav { + ul { + margin: 0; + padding: 0; + list-style: none; } + + li { + display: inline-block; } + + a { + display: block; + padding: 6px 12px; + text-decoration: none; } } + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + border-radius: $radius; } + +.box { + @include border-radius(10px); } + +.message { + border: 1px solid #ccc; + padding: 10px; + color: #333; } + +.success { + @extend .message; + border-color: green; } + +.error { + @extend .message; + border-color: red; } + +.warning { + @extend .message; + border-color: yellow; } + +.foo { + &:before { + content: $pi; } } + +.bar { + &:before { + content: $n-ary-summation; } } + +", + "$n-ary-summation: '\\\\2211'; +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (node-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (node-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (node-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (node-sass) (scss): source map 1`] = ` +Object { + "mappings": ";AAMA,AAAA,IAAI,CAAC;EACH,IAAI,EAAE,IAAI,CALI,SAAS,EAAE,UAAU;EAMnC,KAAK,EALS,IAAI,GAMnB;;AAED,AACE,GADC,CACD,EAAE,CAAC;EACD,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,IAAI,GACjB;;AALH,AAOE,GAPC,CAOD,EAAE,CAAC;EAAE,OAAO,EAAE,YAAY,GAAI;;AAPhC,AASE,GATC,CASD,CAAC,CAAC;EACA,OAAO,EAAE,KAAK;EACd,OAAO,EAAE,QAAQ;EACjB,eAAe,EAAE,IAAI,GACtB;;AAUH,AAAA,IAAI,CAAC;EANH,qBAAqB,EAMO,IAAI;EAL7B,kBAAkB,EAKO,IAAI;EAJ5B,iBAAiB,EAIO,IAAI;EAHxB,aAAa,EAGO,IAAI,GAAK;;AAEvC,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,EAlCK,IAAO,GAmCpB;;AAGH,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,EC5CO,IAAO,GD6CtB", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/scss/language.scss", + "test/scss/another/_variables.scss", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\"; + +$font-stack: Helvetica, sans-serif; +$primary-color: #333; +$pi: '\\\\e0C6'; + +body { + font: 100% $font-stack; + color: $primary-color; +} + +nav { + ul { + margin: 0; + padding: 0; + list-style: none; + } + + li { display: inline-block; } + + a { + display: block; + padding: 6px 12px; + text-decoration: none; + } +} + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + border-radius: $radius; +} + +.box { @include border-radius(10px); } + +.foo { + &:before { + content: $pi; + } +} + +.bar { + &:before { + content: $n-ary-summation; + } +} +", + "$n-ary-summation: '\\\\2211' +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value has "true" value and the "devtool" option has "source-map" value (node-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (dart-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.message, .warning, .error, .success { + border: 1px solid #ccc; + padding: 10px; + color: #333; +} + +.success { + border-color: green; +} + +.error { + border-color: red; +} + +.warning { + border-color: yellow; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (dart-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (dart-sass) (sass): source map 1`] = ` +Object { + "mappings": ";AAMA;EACE;EACA,OALc;;;AAQd;EACE;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;EACA;;;AAQJ;EALE,uBAMe;EALf,oBAKe;EAJf,mBAIe;EAHf,eAGe;;;AAEjB;EACE;EACA;EACA;;;AAEF;EAEE;;;AAEF;EAEE;;;AAEF;EAEE;;;AAGA;EACE,SAhDY;;;AAmDd;EACE,SCxDc", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/sass/language.sass", + "test/sass/another/variables.sass", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\" + +$font-stack: Helvetica, sans-serif +$primary-color: #333 +$pi: '\\\\e0C6' + +body + font: 100% $font-stack + color: $primary-color + +nav + ul + margin: 0 + padding: 0 + list-style: none + + li + display: inline-block + + a + display: block + padding: 6px 12px + text-decoration: none + +=border-radius($radius) + -webkit-border-radius: $radius + -moz-border-radius: $radius + -ms-border-radius: $radius + border-radius: $radius + +.box + +border-radius(10px) + +.message + border: 1px solid #ccc + padding: 10px + color: #333 + +.success + @extend .message + border-color: green + +.error + @extend .message + border-color: red + +.warning + @extend .message + border-color: yellow + +.foo + &:before + content: $pi + +.bar + &:before + content: $n-ary-summation + +", + "$n-ary-summation: '\\\\2211' +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (dart-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (dart-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (dart-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (dart-sass) (scss): source map 1`] = ` +Object { + "mappings": ";AAMA;EACE;EACA,OALc;;;AASd;EACE;EACA;EACA;;AAGF;EAAK;;AAEL;EACE;EACA;EACA;;;AAWJ;EANE,uBAM4B;EALzB,oBAKyB;EAJxB,mBAIwB;EAHpB,eAGoB;;;AAG5B;EACE,SAlCY;;;AAuCd;EACE,SC5Cc", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/scss/language.scss", + "test/scss/another/_variables.scss", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\"; + +$font-stack: Helvetica, sans-serif; +$primary-color: #333; +$pi: '\\\\e0C6'; + +body { + font: 100% $font-stack; + color: $primary-color; +} + +nav { + ul { + margin: 0; + padding: 0; + list-style: none; + } + + li { display: inline-block; } + + a { + display: block; + padding: 6px 12px; + text-decoration: none; + } +} + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + border-radius: $radius; +} + +.box { @include border-radius(10px); } + +.foo { + &:before { + content: $pi; + } +} + +.bar { + &:before { + content: $n-ary-summation; + } +} +", + "$n-ary-summation: '\\\\2211' +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (dart-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (node-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.message, .success, .error, .warning { + border: 1px solid #ccc; + padding: 10px; + color: #333; } + +.success { + border-color: green; } + +.error { + border-color: red; } + +.warning { + border-color: yellow; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (node-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (node-sass) (sass): source map 1`] = ` +Object { + "mappings": ";AAMA,AAAA,IAAI,CAAC;EACH,IAAI,EAAE,IAAI,CALI,SAAS,EAAE,UAAU;EAMnC,KAAK,EALS,IAAI,GAKM;;AAE1B,AACE,GADC,CACD,EAAE,CAAC;EACD,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,IAAI,GAAG;;AAJvB,AAME,GANC,CAMD,EAAE,CAAC;EACD,OAAO,EAAE,YAAY,GAAG;;AAP5B,AASE,GATC,CASD,CAAC,CAAC;EACA,OAAO,EAAE,KAAK;EACd,OAAO,EAAE,QAAQ;EACjB,eAAe,EAAE,IAAI,GAAG;;AAQ5B,AAAA,IAAI,CAAC;EALH,qBAAqB,EAME,IAAI;EAL3B,kBAAkB,EAKK,IAAI;EAJ3B,iBAAiB,EAIM,IAAI;EAH3B,aAAa,EAGU,IAAI,GAAI;;AAEjC,AAAA,QAAQ,EAKR,QAAQ,EAIR,MAAM,EAIN,QAAQ,CAbC;EACP,MAAM,EAAE,cAAc;EACtB,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,IAAI,GAAG;;AAEhB,AAAA,QAAQ,CAAC;EAEP,YAAY,EAAE,KAAK,GAAG;;AAExB,AAAA,MAAM,CAAC;EAEL,YAAY,EAAE,GAAG,GAAG;;AAEtB,AAAA,QAAQ,CAAC;EAEP,YAAY,EAAE,MAAM,GAAG;;AAEzB,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,EAhDK,IAAO,GAgDJ;;AAEnB,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,ECxDO,IAAO,GDwDO", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/sass/language.sass", + "test/sass/another/variables.sass", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\"; + +$font-stack: Helvetica, sans-serif; +$primary-color: #333; +$pi: '\\\\e0C6'; + +body { + font: 100% $font-stack; + color: $primary-color; } + +nav { + ul { + margin: 0; + padding: 0; + list-style: none; } + + li { + display: inline-block; } + + a { + display: block; + padding: 6px 12px; + text-decoration: none; } } + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + border-radius: $radius; } + +.box { + @include border-radius(10px); } + +.message { + border: 1px solid #ccc; + padding: 10px; + color: #333; } + +.success { + @extend .message; + border-color: green; } + +.error { + @extend .message; + border-color: red; } + +.warning { + @extend .message; + border-color: yellow; } + +.foo { + &:before { + content: $pi; } } + +.bar { + &:before { + content: $n-ary-summation; } } + +", + "$n-ary-summation: '\\\\2211'; +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (node-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (node-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (node-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (node-sass) (scss): source map 1`] = ` +Object { + "mappings": ";AAMA,AAAA,IAAI,CAAC;EACH,IAAI,EAAE,IAAI,CALI,SAAS,EAAE,UAAU;EAMnC,KAAK,EALS,IAAI,GAMnB;;AAED,AACE,GADC,CACD,EAAE,CAAC;EACD,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,IAAI,GACjB;;AALH,AAOE,GAPC,CAOD,EAAE,CAAC;EAAE,OAAO,EAAE,YAAY,GAAI;;AAPhC,AASE,GATC,CASD,CAAC,CAAC;EACA,OAAO,EAAE,KAAK;EACd,OAAO,EAAE,QAAQ;EACjB,eAAe,EAAE,IAAI,GACtB;;AAUH,AAAA,IAAI,CAAC;EANH,qBAAqB,EAMO,IAAI;EAL7B,kBAAkB,EAKO,IAAI;EAJ5B,iBAAiB,EAIO,IAAI;EAHxB,aAAa,EAGO,IAAI,GAAK;;AAEvC,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,EAlCK,IAAO,GAmCpB;;AAGH,AACE,IADE,AACD,OAAO,CAAC;EACP,OAAO,EC5CO,IAAO,GD6CtB", + "names": Array [], + "sourceRoot": "", + "sources": Array [ + "test/scss/language.scss", + "test/scss/another/_variables.scss", + ], + "sourcesContent": Array [ + "@import \\"another/variables\\"; + +$font-stack: Helvetica, sans-serif; +$primary-color: #333; +$pi: '\\\\e0C6'; + +body { + font: 100% $font-stack; + color: $primary-color; +} + +nav { + ul { + margin: 0; + padding: 0; + list-style: none; + } + + li { display: inline-block; } + + a { + display: block; + padding: 6px 12px; + text-decoration: none; + } +} + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + border-radius: $radius; +} + +.box { @include border-radius(10px); } + +.foo { + &:before { + content: $pi; + } +} + +.bar { + &:before { + content: $n-ary-summation; + } +} +", + "$n-ary-summation: '\\\\2211' +", + ], + "version": 3, +} +`; + exports[`sourceMap option should generate source maps when value is not specified and the "devtool" option has "source-map" value (node-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (dart-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.message, .warning, .error, .success { + border: 1px solid #ccc; + padding: 10px; + color: #333; +} + +.success { + border-color: green; +} + +.error { + border-color: red; +} + +.warning { + border-color: yellow; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (dart-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (dart-sass) (sass): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (dart-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (dart-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (dart-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (dart-sass) (scss): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (dart-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (node-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.message, .success, .error, .warning { + border: 1px solid #ccc; + padding: 10px; + color: #333; } + +.success { + border-color: green; } + +.error { + border-color: red; } + +.warning { + border-color: yellow; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (node-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (node-sass) (sass): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (node-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (node-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (node-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (node-sass) (scss): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "false" value (node-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (dart-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.message, .warning, .error, .success { + border: 1px solid #ccc; + padding: 10px; + color: #333; +} + +.success { + border-color: green; +} + +.error { + border-color: red; +} + +.warning { + border-color: yellow; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (dart-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (dart-sass) (sass): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (dart-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (dart-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (dart-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (dart-sass) (scss): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (dart-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (node-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.message, .success, .error, .warning { + border: 1px solid #ccc; + padding: 10px; + color: #333; } + +.success { + border-color: green; } + +.error { + border-color: red; } + +.warning { + border-color: yellow; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (node-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (node-sass) (sass): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (node-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (node-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (node-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (node-sass) (scss): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value has "false" value and the "devtool" option has "source-map" value (node-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (dart-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.message, .warning, .error, .success { + border: 1px solid #ccc; + padding: 10px; + color: #333; +} + +.success { + border-color: green; +} + +.error { + border-color: red; +} + +.warning { + border-color: yellow; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (dart-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (dart-sass) (sass): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (dart-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (dart-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; +} + +nav ul { + margin: 0; + padding: 0; + list-style: none; +} +nav li { + display: inline-block; +} +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; +} + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; +} + +.foo:before { + content: \\"\\"; +} + +.bar:before { + content: \\"∑\\"; +}" +`; + exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (dart-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (dart-sass) (scss): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (dart-sass) (scss): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (node-sass) (sass): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.message, .success, .error, .warning { + border: 1px solid #ccc; + padding: 10px; + color: #333; } + +.success { + border-color: green; } + +.error { + border-color: red; } + +.warning { + border-color: yellow; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (node-sass) (sass): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (node-sass) (sass): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (node-sass) (sass): warnings 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (node-sass) (scss): css 1`] = ` +"@charset \\"UTF-8\\"; +body { + font: 100% Helvetica, sans-serif; + color: #333; } + +nav ul { + margin: 0; + padding: 0; + list-style: none; } + +nav li { + display: inline-block; } + +nav a { + display: block; + padding: 6px 12px; + text-decoration: none; } + +.box { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + border-radius: 10px; } + +.foo:before { + content: \\"\\"; } + +.bar:before { + content: \\"∑\\"; } +" +`; + exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (node-sass) (scss): errors 1`] = `Array []`; +exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (node-sass) (scss): source map 1`] = `undefined`; + exports[`sourceMap option should not generate source maps when value is not specified and the "devtool" option has "false" value (node-sass) (scss): warnings 1`] = `Array []`; diff --git a/test/sourceMap-options.test.js b/test/sourceMap-options.test.js index 2b77c4a9..f2a68b75 100644 --- a/test/sourceMap-options.test.js +++ b/test/sourceMap-options.test.js @@ -40,8 +40,13 @@ describe('sourceMap option', () => { const stats = await compile(compiler); const { css, sourceMap } = getCodeFromBundle(stats, compiler); - expect(css).toBeDefined(); - expect(sourceMap).toBeDefined(); + sourceMap.sourceRoot = ''; + sourceMap.sources = sourceMap.sources.map((source) => + source.replace(/\\/g, '/') + ); + + expect(css).toMatchSnapshot('css'); + expect(sourceMap).toMatchSnapshot('source map'); expect(getWarnings(stats)).toMatchSnapshot('warnings'); expect(getErrors(stats)).toMatchSnapshot('errors'); }); @@ -58,8 +63,8 @@ describe('sourceMap option', () => { const stats = await compile(compiler); const { css, sourceMap } = getCodeFromBundle(stats, compiler); - expect(css).toBeDefined(); - expect(sourceMap).toBeUndefined(); + expect(css).toMatchSnapshot('css'); + expect(sourceMap).toMatchSnapshot('source map'); expect(getWarnings(stats)).toMatchSnapshot('warnings'); expect(getErrors(stats)).toMatchSnapshot('errors'); }); @@ -77,8 +82,8 @@ describe('sourceMap option', () => { const stats = await compile(compiler); const { css, sourceMap } = getCodeFromBundle(stats, compiler); - expect(css).toBeDefined(); - expect(sourceMap).toBeUndefined(); + expect(css).toMatchSnapshot('css'); + expect(sourceMap).toMatchSnapshot('source map'); expect(getWarnings(stats)).toMatchSnapshot('warnings'); expect(getErrors(stats)).toMatchSnapshot('errors'); }); @@ -96,14 +101,14 @@ describe('sourceMap option', () => { const stats = await compile(compiler); const { css, sourceMap } = getCodeFromBundle(stats, compiler); - expect(css).toBeDefined(); - expect(sourceMap).toBeUndefined(); + expect(css).toMatchSnapshot('css'); + expect(sourceMap).toMatchSnapshot('source map'); expect(getWarnings(stats)).toMatchSnapshot('warnings'); expect(getErrors(stats)).toMatchSnapshot('errors'); }); it(`should generate source maps when value has "true" value and the "devtool" option has "source-map" value (${implementationName}) (${syntax})`, async () => { - expect.assertions(9); + expect.assertions(6); const testId = getTestId('language', syntax); const options = { @@ -117,12 +122,13 @@ describe('sourceMap option', () => { const stats = await compile(compiler); const { css, sourceMap } = getCodeFromBundle(stats, compiler); - expect(css).toBeDefined(); - expect(sourceMap).toBeDefined(); + sourceMap.sourceRoot = ''; + sourceMap.sources = sourceMap.sources.map((source) => + source.replace(/\\/g, '/') + ); - expect(sourceMap.file).toBeUndefined(); - expect(sourceMap.sourceRoot).toBeDefined(); - expect(sourceMap.sources).toHaveLength(2); + expect(css).toMatchSnapshot('css'); + expect(sourceMap).toMatchSnapshot('source map'); sourceMap.sources.forEach((sourcePath) => { expect( @@ -135,7 +141,7 @@ describe('sourceMap option', () => { }); it(`should generate source maps when value has "true" value and the "devtool" option has "false" value (${implementationName}) (${syntax})`, async () => { - expect.assertions(9); + expect.assertions(6); const testId = getTestId('language', syntax); const options = { @@ -149,12 +155,13 @@ describe('sourceMap option', () => { const stats = await compile(compiler); const { css, sourceMap } = getCodeFromBundle(stats, compiler); - expect(css).toBeDefined(); - expect(sourceMap).toBeDefined(); + sourceMap.sourceRoot = ''; + sourceMap.sources = sourceMap.sources.map((source) => + source.replace(/\\/g, '/') + ); - expect(sourceMap.file).toBeUndefined(); - expect(sourceMap.sourceRoot).toBeDefined(); - expect(sourceMap.sources).toHaveLength(2); + expect(css).toMatchSnapshot('css'); + expect(sourceMap).toMatchSnapshot('source map'); sourceMap.sources.forEach((sourcePath) => { expect(