Commit 2e89d630 by Andrew Nesbitt

Merge pull request #334 from sindresorhus/fix-includepaths-renderfile

don't prepareOptions twice in `renderFile()`
parents 5e7a7e68 731e25f1
...@@ -143,7 +143,6 @@ exports.renderSync = function(options) { ...@@ -143,7 +143,6 @@ exports.renderSync = function(options) {
exports.renderFile = function(options) { exports.renderFile = function(options) {
var success; var success;
options = prepareOptions(options);
success = options.success; success = options.success;
if (options.sourceMap === true) { if (options.sourceMap === true) {
options.sourceMap = path.basename(options.outFile) + '.map'; options.sourceMap = path.basename(options.outFile) + '.map';
......
@import "lib/vars"; @import "vars";
@import "functions/colorBlue"; @import "colorBlue";
body { background: $color; color: colorBlue(); } body { background: $color; color: colorBlue(); }
...@@ -104,6 +104,22 @@ describe('compile file with include paths', function(){ ...@@ -104,6 +104,22 @@ describe('compile file with include paths', function(){
} }
}); });
}); });
it('should compile with renderFile', function(done) {
var testFile = path.resolve(__dirname, 'tmp-include-path.css');
sass.renderFile({
file: path.resolve(__dirname, 'include_path.scss'),
outFile: testFile,
includePaths: [path.resolve(__dirname, 'lib'), path.resolve(__dirname, 'functions')],
success: function () {
done(assert.equal(fs.readFileSync(testFile, 'utf8'), 'body {\n background: red;\n color: #0000fe; }\n'));
fs.unlinkSync(testFile);
},
error: function (error) {
done(error);
}
});
});
}); });
describe('compile file with image path', function(){ describe('compile file with image path', function(){
......
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