Skip to content

Commit 904cb15

Browse files
committed
Merge pull request #87 from xzyfer/feat/node-sass-3
Update for node-sass@3
2 parents e3d7d67 + 0b1ea14 commit 904cb15

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@
3838
"devDependencies": {
3939
"chalk": "^0.5.1",
4040
"jasmine-node": "^1.14.5",
41-
"node-sass": "^2.0.0-beta"
41+
"node-sass": "^3.4.2"
4242
}
4343
}

test/compileSpec.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@ describe("Imports", function () {
1010
done();
1111
}
1212

13-
["imports", "imports_animation"].forEach(function(importFile) {
13+
["imports.scss", "imports_animation.scss"].forEach(function(importFile) {
1414
sass.render({
1515
file: __dirname + "/" + importFile,
16-
success: function(s){
17-
success();
18-
complete();
19-
},
20-
error: function(e){
16+
}, function(e, s) {
17+
if (e) {
2118
console.log(chalk.red("Sass error:"), e);
22-
complete();
19+
} else {
20+
success();
2321
}
22+
complete();
2423
});
2524
});
2625

test/css3/borderRadiusSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var ruleset = require('../helper/ruleset');
44
describe("CSS3 Border Radius", function () {
55

66
it("should generate a border radius", function (done) {
7-
render(ruleset('$experimental-support-for-mozilla: false; $experimental-support-for-opera: false; @include border-radius(0, 0)'), function(output, err) {
7+
render(ruleset('$experimental-support-for-mozilla: false !global; $experimental-support-for-opera: false !global; @include border-radius(0, 0)'), function(output, err) {
88
expect(output).toBe(ruleset('-webkit-border-radius:0 0;border-radius:0 / 0'));
99
done();
1010
}, ['compass/css3/border-radius']);

test/css3/boxShadowSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var ruleset = require('../helper/ruleset');
44
describe("CSS3 Box Shadow", function () {
55

66
it("should generate a default box shadow", function (done) {
7-
render(ruleset('$default-box-shadow-inset: inset; $default-box-shadow-h-offset: 23px; $default-box-shadow-v-offset: 24px; $default-box-shadow-blur: 17px; $default-box-shadow-spread: 15px; $default-box-shadow-color: #DEADBE; $experimental-support-for-mozilla: false; $experimental-support-for-opera: false; @include box-shadow'), function(output, err) {
7+
render(ruleset('$default-box-shadow-inset: inset !global; $default-box-shadow-h-offset: 23px !global; $default-box-shadow-v-offset: 24px !global; $default-box-shadow-blur: 17px !global; $default-box-shadow-spread: 15px !global; $default-box-shadow-color: #DEADBE !global; $experimental-support-for-mozilla: false !global; $experimental-support-for-opera: false !global; @include box-shadow'), function(output, err) {
88
expect(output).toBe(ruleset('-webkit-box-shadow:inset 23px 24px 17px 15px #DEADBE;box-shadow:inset 23px 24px 17px 15px #DEADBE'));
99
done();
1010
}, ['compass/css3/box-shadow']);

test/css3/imagesSpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ describe("CSS3 Images", function () {
1111
});
1212

1313
it("should generate multiple backgrounds", function (done) {
14-
render(ruleset('$support-for-original-webkit-gradients: false; $experimental-support-for-mozilla: false; $experimental-support-for-opera: false; @include background(a, b, c)'), function(output, err) {
14+
render(ruleset('$support-for-original-webkit-gradients: false !global; $experimental-support-for-mozilla: false !global; $experimental-support-for-opera: false !global; @include background(a, b, c)'), function(output, err) {
1515
expect(output).toBe(ruleset('background:-webkit-a,-webkit-b,-webkit-c;background:a,b,c'));
1616
done();
1717
}, ['compass/css3/images']);
1818
});
1919

2020
it("should generate multiple backgrounds of different types", function (done) {
21-
render(ruleset('$support-for-original-webkit-gradients: false; $experimental-support-for-mozilla: false; $experimental-support-for-opera: false; @include background(#fff, url(1.gif), linear-gradient(white, black))'), function(output, err) {
22-
expect(output).toBe(ruleset('background:#fff,url(1.gif),-webkit-linear-gradient(white, black);background:#fff,url(1.gif),linear-gradient(white, black)'));
21+
render(ruleset('$support-for-original-webkit-gradients: false !global; $experimental-support-for-mozilla: false !global; $experimental-support-for-opera: false !global; @include background(#fff, url(1.gif), linear-gradient(white, black))'), function(output, err) {
22+
expect(output).toBe(ruleset('background:#fff,url(1.gif),-webkit-linear-gradient(#fff, #000);background:#fff,url(1.gif),linear-gradient(#fff, #000)'));
2323
done();
2424
}, ['compass/css3/images']);
2525
});

test/css3/transitionSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var ruleset = require('../helper/ruleset');
44
describe("CSS3 Transition", function () {
55

66
it("should generate a transition", function (done) {
7-
render(ruleset('$experimental-support-for-mozilla: false; $experimental-support-for-opera: false; @include transition(ok 0s);'), function(output, err) {
7+
render(ruleset('$experimental-support-for-mozilla: false !global; $experimental-support-for-opera: false !global; @include transition(ok 0s);'), function(output, err) {
88
expect(output).toBe(ruleset('-webkit-transition:ok 0s;transition:ok 0s'));
99
done();
1010
}, ['compass/css3/transition']);

test/functionsSpec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe("Cross Browser Functions", function () {
8080

8181
it("should prefix a list of complex properties", function(done) {
8282
render(property('prefix(-webkit, linear-gradient(-45deg, rgb(0,0,0) 25%, transparent 75%, transparent), linear-gradient(-45deg, #000 25%, transparent 75%, transparent))'), function(output, err) {
83-
expect(output).toBe(property('-webkit-linear-gradient(-45deg, #000000 25%, transparent 75%, transparent),-webkit-linear-gradient(-45deg, #000 25%, transparent 75%, transparent)'));
83+
expect(output).toBe(property('-webkit-linear-gradient(-45deg, #000 25%, transparent 75%, transparent),-webkit-linear-gradient(-45deg, #000 25%, transparent 75%, transparent)'));
8484
done();
8585
});
8686
});
@@ -126,7 +126,7 @@ describe("Gradient Functions", function () {
126126

127127
it("should prefix a list with color stops", function(done) {
128128
render(property('prefix(-webkit, linear-gradient(-45deg, color-stops(rgb(0,0,0) 25%, transparent 75%, transparent)), linear-gradient(-45deg, color-stops(#000 25%, transparent 75%, transparent)))'), function(output, err) {
129-
expect(output).toBe(property('-webkit-linear-gradient(-45deg, #000000 25%, transparent 75%, transparent),-webkit-linear-gradient(-45deg, #000 25%, transparent 75%, transparent)'));
129+
expect(output).toBe(property('-webkit-linear-gradient(-45deg, #000 25%,transparent 75%,transparent),-webkit-linear-gradient(-45deg, #000 25%,transparent 75%,transparent)'));
130130
done();
131131
});
132132
});

test/helper/render.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ module.exports = function(data, callback, imports) {
88
sass.render({
99
data: '@import "'+libDir+'/compass/functions";' + imports.join('') + data,
1010
outputStyle: 'compressed',
11-
success: function(output){
12-
callback(output.css);
13-
},
14-
error: function(err){
11+
includePaths: [__dirname],
12+
}, function(err, output) {
13+
if (err) {
1514
console.log(chalk.red("Sass error:"), err);
1615
callback('', err);
16+
} else {
17+
callback(output.css.toString().trim());
1718
}
1819
});
1920
}

0 commit comments

Comments
 (0)