diff --git a/package.json b/package.json index e37b310..1ab0e67 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A tokenzier for Sass' SCSS syntax", "main": "index.js", "scripts": { - "test": "node test/sass-spec.js" + "test": "mocha" }, "repository": { "type": "git", @@ -29,7 +29,9 @@ "source-map": "^0.4.2" }, "devDependencies": { + "chai": "^3.5.0", "glob": "^5.0.10", + "mocha": "^3.2.0", "sass-spec": "^3.5.0-1" } } diff --git a/test/sass-spec.js b/test/sass-spec.js index d2374e3..c84cd7d 100644 --- a/test/sass-spec.js +++ b/test/sass-spec.js @@ -19,14 +19,18 @@ var files = glob.sync(path.join(spec.dirname, 'spec/**/input.scss')); // If an uncaught exception is thrown we report the failure to the user. // ----------------------------------------------------------------------------- -for(i = 0; i < files.length; i++) { - file = files[i]; - errorFile = path.join(path.dirname(file), 'error'); +describe('Sass spec', function() { + it('should tokenize all specs', function() { + for(i = 0; i < files.length; i++) { + file = files[i]; + errorFile = path.join(path.dirname(file), 'error'); - try { - if (fs.statSync(errorFile)) continue; - } catch (e) { } + try { + if (fs.statSync(errorFile)) continue; + } catch (e) { } - contents = fs.readFileSync(file, { encoding: 'utf8' }); - scss.tokenize(contents); -} + contents = fs.readFileSync(file, { encoding: 'utf8' }); + scss.tokenize(contents); + } + }).timeout(15000); +});