Commit 5265e7b3 by Andrew Nesbitt

Merge pull request #44 from samccone/sjs/add_mocha_tests

add real tests!
parents 60f66275 1ab7f9b7
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
"url": "git://github.com/andrew/node-sass.git" "url": "git://github.com/andrew/node-sass.git"
}, },
"scripts": { "scripts": {
"install": "node rebuild.js" "install": "node rebuild.js",
"test": "mocha test"
}, },
"gypfile": true, "gypfile": true,
"engines": { "engines": {
......
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);
}
});
});
});
\ No newline at end of file
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