Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

add real tests! #44

Merged
merged 1 commit into from
Dec 3, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"url": "git://github.com/andrew/node-sass.git"
},
"scripts": {
"install": "node rebuild.js"
"install": "node rebuild.js",
"test": "mocha test"
},
"gypfile": true,
"engines": {
Expand Down
44 changes: 44 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
var sass = require('../sass');
var assert = require('assert');


var scssStr = '#navbar {\
width: 80%;\
height: 23px; }\
#navbar ul {\
list-style-type: none; }\
#navbar li {\
float: left;\
a {\
font-weight: bold; }}';

var expectedRender = '#navbar {\n\
width: 80%;\n\
height: 23px; }\n\
\n\
#navbar ul {\n\
list-style-type: none; }\n\
\n\
#navbar li {\n\
float: left; }\n\
#navbar li a {\n\
font-weight: bold; }\n';


describe("compile scss", function() {
it("should compile", function(done) {
sass.render(scssStr, function(err, css) {
done(err);
});
});

it("should match compiled string", function(done) {
sass.render(scssStr, function(err, css) {
if (!err) {
done(assert.equal(css, expectedRender));
} else {
done(err);
}
});
});
});