From a50dce0ec9c0ae07f533cbdc7fa12518c1a11039 Mon Sep 17 00:00:00 2001 From: Michael Hellein Date: Tue, 5 Aug 2014 07:18:56 -0400 Subject: [PATCH] Provided initial compass compile test. This only tests that importing compass does not error. --- package.json | 10 +++++++++- test/compileSpec.js | 25 +++++++++++++++++++++++++ test/imports.scss | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 test/compileSpec.js create mode 100644 test/imports.scss diff --git a/package.json b/package.json index 356b571..85d7320 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,9 @@ "sass", "css3" ], + "scripts": { + "test": "./node_modules/jasmine-node/bin/jasmine-node test" + }, "license": "MIT", "ignore": [ "**/.*", @@ -23,5 +26,10 @@ "bower_components", "test", "tests" - ] + ], + "devDependencies": { + "chalk": "^0.5.1", + "jasmine-node": "^1.14.5", + "node-sass": "^0.9.3" + } } diff --git a/test/compileSpec.js b/test/compileSpec.js new file mode 100644 index 0000000..232619e --- /dev/null +++ b/test/compileSpec.js @@ -0,0 +1,25 @@ +var sass = require('node-sass'); +var chalk = require('chalk'); + +describe("Imports", function () { + it("should import all the provided files without an error", function (done) { + var success = jasmine.createSpy('ImportSuccess'); + + function complete() { + expect(success).toHaveBeenCalled(); + done(); + } + + sass.render({ + file: __dirname + "/imports.scss", + success: function(s){ + success(); + complete(); + }, + error: function(e){ + complete(); + console.log(chalk.red("Sass error:"), e); + } + }); + }); +}); \ No newline at end of file diff --git a/test/imports.scss b/test/imports.scss new file mode 100644 index 0000000..9e2b78f --- /dev/null +++ b/test/imports.scss @@ -0,0 +1 @@ +@import "../lib/compass";