Skip to content

Commit

Permalink
Use mocha for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyfer committed Jan 28, 2017
1 parent 79dd087 commit a87c091
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
22 changes: 13 additions & 9 deletions test/sass-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

0 comments on commit a87c091

Please sign in to comment.