Skip to content

Commit

Permalink
Feat: Replace node-sass with sass
Browse files Browse the repository at this point in the history
  • Loading branch information
paullessing committed Oct 25, 2021
1 parent 5ef5515 commit 247f4c6
Show file tree
Hide file tree
Showing 4 changed files with 1,727 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"cssmin": "^0.4.3",
"minimist": "^1.2.0",
"node-sass": "^3.1.2, ^4.0.0"
"sass": "^1.43.3"
},
"devDependencies": {
"cross-spawn": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/compile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var sass = require('node-sass');
var sass = require('sass');
var cssmin = require('cssmin');

function wrapValue(value) {
Expand Down
8 changes: 4 additions & 4 deletions test/compileTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var sinon = require('sinon');
describe('Compile', function() {
var correctlyWrapped;
var minifiedWrapped;
var nodeSassStub;
var sassStub;
var cssminStub;
var Compile;
var scssString;
Expand All @@ -16,13 +16,13 @@ describe('Compile', function() {
scssString = '1px solid blue';
correctlyWrapped = '.test { content: ' + scssString + ' };';
minifiedWrapped = '.test{content:' + scssString + '}';
nodeSassStub = {
sassStub = {
renderSync: sinon.stub().returns({ css: correctlyWrapped })
};
cssminStub = sinon.stub().returns(minifiedWrapped);

Compile = proxyquire('../src/compile', {
'node-sass': nodeSassStub,
'sass': sassStub,
'cssmin': cssminStub
});
});
Expand All @@ -47,7 +47,7 @@ describe('Compile', function() {
it('returns the compiled scss given to it as an argument', function() {
var compiled = Compile.fromString(scssString);

assert.ok(nodeSassStub.renderSync.calledWith({ data: correctlyWrapped }));
assert.ok(sassStub.renderSync.calledWith({ data: correctlyWrapped }));
assert.ok(cssminStub.calledWith(correctlyWrapped));
assert.strictEqual(compiled, scssString);
});
Expand Down
Loading

0 comments on commit 247f4c6

Please sign in to comment.