Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-sass

Package Overview
Dependencies
Maintainers
7
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-sass - npm Package Compare versions

Comparing version 3.9.3 to 3.10.0-1

20

CHANGELOG.md

@@ -0,1 +1,21 @@

## v3.10.1
https://github.com/sass/node-sass/releases/tag/v3.10.1
## v3.10.0
https://github.com/sass/node-sass/releases/tag/v3.10.0
## v3.9.3
https://github.com/sass/node-sass/releases/tag/v3.9.3
## v3.9.2
(removed)
## v3.9.1
(removed)
## v3.9.0

@@ -2,0 +22,0 @@

6

lib/index.js

@@ -6,5 +6,5 @@ /*!

var path = require('path'),
util = require('util'),
clonedeep = require('lodash.clonedeep'),
errors = require('./errors'),
assign = require('lodash.assign'),
sass = require('./extensions');

@@ -293,3 +293,3 @@

options.error = function(err) {
var payload = util._extend(new Error(), JSON.parse(err));
var payload = assign(new Error(), JSON.parse(err));

@@ -442,3 +442,3 @@ if (cb) {

throw util._extend(new Error(), JSON.parse(result.error));
throw assign(new Error(), JSON.parse(result.error));
};

@@ -445,0 +445,0 @@

{
"name": "node-sass",
"version": "3.9.3",
"version": "3.10.0-1",
"libsass": "3.3.6",

@@ -63,2 +63,3 @@ "description": "Wrapper around libsass",

"in-publish": "^2.0.0",
"lodash.assign": "^4.2.0",
"lodash.clonedeep": "^4.3.2",

@@ -75,8 +76,11 @@ "meow": "^3.7.0",

"coveralls": "^2.11.8",
"eslint": "^2.9.0",
"eslint": "^3.4.0",
"istanbul": "^0.4.2",
"mocha": "^2.4.5",
"mocha-lcov-reporter": "^1.2.0",
"rimraf": "^2.5.2"
"object-merge": "^2.5.1",
"read-yaml": "^1.0.0",
"rimraf": "^2.5.2",
"sass-spec": "^3.3.6-3"
}
}

@@ -150,3 +150,3 @@ /*eslint new-cap: ["error", {"capIsNewExceptions": ["Color"]}]*/

envIncludes = [
var envIncludes = [
fixture('sass-path/red'),

@@ -179,3 +179,3 @@ fixture('sass-path/orange')

envIncludes = [
var envIncludes = [
fixture('sass-path/red')

@@ -1855,15 +1855,4 @@ ];

describe('missing error', function() {
beforeEach(function() {
process.env.SASS_BINARY_NAME = [
(process.platform === 'win32' ? 'Linux' : 'Windows'), '-',
process.arch, '-',
process.versions.modules
].join('');
});
afterEach(function() {
delete process.env.SASS_BINARY_NAME;
});
it('should be useful', function() {
process.env.SASS_BINARY_NAME = 'Linux-x64-48';
assert.throws(

@@ -1870,0 +1859,0 @@ function() { require(sassPath); },

var assert = require('assert'),
fs = require('fs'),
exists = fs.existsSync,
path = require('path'),
join = require('path').join,
read = fs.readFileSync,

@@ -9,55 +9,174 @@ sass = process.env.NODESASS_COV

: require('../lib'),
util = require('./util');
readYaml = require('read-yaml'),
objectMerge = require('object-merge'),
glob = require('glob'),
specPath = require('sass-spec').dirname.replace(/\\/g, '/'),
impl = 'libsass',
version = 3.4;
describe('spec', function() {
this.timeout(0);
var suites = util.getSuites();
var normalize = function(str) {
// This should be /\r\n/g, '\n', but there seems to be some empty line issues
return str.replace(/\s+/g, '');
};
describe('test/sass-spec directory', function() {
it('should be a cloned into place', function(done) {
fs.exists(path.join(__dirname, 'fixtures', 'spec'), function(exists) {
if (!exists) {
throw new Error([
'test/fixtures/spec directory missing. Please clone it into place by',
'executing `git submodule update --init --recursive test/fixtures/spec`',
'from the project\'s root directory.'
].join(' '));
var inputs = glob.sync(specPath + '/**/input.*');
var initialize = function(inputCss, options) {
var testCase = {};
var folders = inputCss.split('/');
var folder = join(inputCss, '..');
testCase.folder = folder;
testCase.name = folders[folders.length - 2];
testCase.inputPath = inputCss;
testCase.expectedPath = join(folder, 'expected_output.css');
testCase.errorPath = join(folder, 'error');
testCase.statusPath = join(folder, 'status');
testCase.optionsPath = join(folder, 'options.yml');
if (exists(testCase.optionsPath)) {
options = objectMerge(options, readYaml.sync(testCase.optionsPath));
}
testCase.includePaths = [
folder,
join(folder, 'sub')
];
testCase.precision = parseFloat(options[':precision']) || 5;
testCase.outputStyle = options[':output_style'] ? options[':output_style'].replace(':', '') : 'nested';
testCase.todo = options[':todo'] !== undefined && options[':todo'] !== null && options[':todo'].indexOf(impl) !== -1;
testCase.warningTodo = options[':warning_todo'] !== undefined && options[':warning_todo'] !== null && options[':warning_todo'].indexOf(impl) !== -1;
testCase.startVersion = parseFloat(options[':start_version']) || 0;
testCase.endVersion = parseFloat(options[':end_version']) || 99;
testCase.options = options;
testCase.result = false;
// Probe filesystem once and cache the results
testCase.shouldFail = exists(testCase.statusPath) && !fs.statSync(testCase.statusPath).isDirectory();
testCase.verifyStderr = exists(testCase.errorPath) && !fs.statSync(testCase.errorPath).isDirectory();
return testCase;
};
var runTest = function(inputCssPath, options) {
var test = initialize(inputCssPath, options);
it(test.name, function(done) {
if (test.todo || test.warningTodo) {
this.skip('Test marked with TODO');
} else if (version < test.startVersion) {
this.skip('Tests marked for newer Sass versions only');
} else if (version > test.endVersion) {
this.skip('Tests marked for older Sass versions only');
} else {
var expected = normalize(read(test.expectedPath, 'utf8'));
sass.render({
file: test.inputPath,
includePaths: test.includePaths,
precision: test.precision,
outputStyle: test.outputStyle
}, function(error, result) {
if (test.shouldFail) {
// Replace 1, with parseInt(read(test.statusPath, 'utf8')) pending
// https://github.com/sass/libsass/issues/2162
assert.equal(error.status, 1);
} else if (test.verifyStderr) {
var expectedError = read(test.errorPath, 'utf8');
if (error === null) {
// Probably a warning
assert.ok(expectedError, 'Expected some sort of warning, but found none');
} else {
// The error messages seem to have some differences in areas
// like line numbering, so we'll check the first line for the
// general errror message only
assert.equal(
error.formatted.toString().split('\n')[0],
expectedError.toString().split('\n')[0],
'Should Error.\nOptions' + JSON.stringify(test.options));
}
} else if (expected) {
assert.equal(
normalize(result.css.toString()),
expected,
'Should equal with options ' + JSON.stringify(test.options)
);
}
assert(exists);
done();
});
});
}
});
};
Object.keys(suites).forEach(function(suite) {
var tests = Object.keys(suites[suite]);
var specSuite = {
name: specPath.split('/').slice(-1)[0],
folder: specPath,
tests: [],
suites: [],
options: {}
};
var executeSuite = function(suite, tests) {
var suiteFolderLength = suite.folder.split('/').length;
var optionsFile = join(suite.folder, 'options.yml');
if (exists(optionsFile)) {
suite.options = objectMerge(suite.options, readYaml.sync(optionsFile));
}
describe(suite, function() {
tests.forEach(function(test) {
var t = suites[suite][test];
// Push tests in the current suite
tests = tests.filter(function(test) {
var testSuiteFolder = test.split('/');
var inputSass = testSuiteFolder[suiteFolderLength + 1];
// Add the test if the specPath matches the testname
if (inputSass === 'input.scss' || inputSass === 'input.sass') {
suite.tests.push(test);
} else {
return test;
}
});
if (exists(t.src)) {
it(test, function(done) {
var expected = util.normalize(read(t.expected, 'utf8'));
sass.render({
file: t.src,
includePaths: t.paths
}, function(error, result) {
if (t.error) {
assert(error);
} else {
assert(!error);
}
if (expected) {
assert.equal(util.normalize(result.css.toString()), expected);
}
done();
});
});
}
});
if (tests.length !== 0) {
var prevSuite = tests[0].split('/')[suiteFolderLength];
var suiteName = '';
var prevSuiteStart = 0;
for (var i = 0; i < tests.length; i++) {
var test = tests[i];
suiteName = test.split('/')[suiteFolderLength];
if (suiteName !== prevSuite) {
suite.suites.push(
executeSuite(
{
name: prevSuite,
folder: suite.folder + '/' + prevSuite,
tests: [],
suites: [],
options: suite.options
},
tests.slice(prevSuiteStart, i)
)
);
prevSuite = suiteName;
prevSuiteStart = i;
}
}
suite.suites.push(
executeSuite(
{
name: suiteName,
folder: suite.folder + '/' + suiteName,
tests: [],
suites: [],
options: suite.options
},
tests.slice(prevSuiteStart, tests.length)
)
);
}
return suite;
};
var allSuites = executeSuite(specSuite, inputs);
var runSuites = function(suite) {
describe(suite.name, function(){
suite.tests.forEach(function(test){
runTest(test, suite.options);
});
suite.suites.forEach(function(subsuite) {
runSuites(subsuite);
});
});
});
};
runSuites(allSuites);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc