Commit 21ac22e4 by Adeel

renderSync: Returns both css and map.

parent 9ce6de02
...@@ -294,5 +294,8 @@ module.exports.middleware = function() { ...@@ -294,5 +294,8 @@ module.exports.middleware = function() {
endStats(options, options.stats.sourceMap); endStats(options, options.stats.sourceMap);
return output; return {
css: output,
map: options.stats.sourceMap
};
}; };
...@@ -143,7 +143,7 @@ describe('api', function() { ...@@ -143,7 +143,7 @@ describe('api', function() {
it('should compile sass to css', function(done) { it('should compile sass to css', function(done) {
var src = read(fixture('simple/index.scss'), 'utf8'); var src = read(fixture('simple/index.scss'), 'utf8');
var expected = read(fixture('simple/expected.css'), 'utf8').trim(); var expected = read(fixture('simple/expected.css'), 'utf8').trim();
var css = sass.renderSync({data: src}).trim(); var css = sass.renderSync({data: src}).css.trim();
assert.equal(css, expected.replace(/\r\n/g, '\n')); assert.equal(css, expected.replace(/\r\n/g, '\n'));
done(); done();
...@@ -155,7 +155,7 @@ describe('api', function() { ...@@ -155,7 +155,7 @@ describe('api', function() {
var css = sass.renderSync({ var css = sass.renderSync({
data: src, data: src,
indentedSyntax: true indentedSyntax: true
}).trim(); }).css.trim();
assert.equal(css, expected.replace(/\r\n/g, '\n')); assert.equal(css, expected.replace(/\r\n/g, '\n'));
done(); done();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment