Skip to content

Commit a87c091

Browse files
committed
Use mocha for tests
1 parent 79dd087 commit a87c091

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A tokenzier for Sass' SCSS syntax",
55
"main": "index.js",
66
"scripts": {
7-
"test": "node test/sass-spec.js"
7+
"test": "mocha"
88
},
99
"repository": {
1010
"type": "git",
@@ -29,7 +29,9 @@
2929
"source-map": "^0.4.2"
3030
},
3131
"devDependencies": {
32+
"chai": "^3.5.0",
3233
"glob": "^5.0.10",
34+
"mocha": "^3.2.0",
3335
"sass-spec": "^3.5.0-1"
3436
}
3537
}

test/sass-spec.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ var files = glob.sync(path.join(spec.dirname, 'spec/**/input.scss'));
1919
// If an uncaught exception is thrown we report the failure to the user.
2020
// -----------------------------------------------------------------------------
2121

22-
for(i = 0; i < files.length; i++) {
23-
file = files[i];
24-
errorFile = path.join(path.dirname(file), 'error');
22+
describe('Sass spec', function() {
23+
it('should tokenize all specs', function() {
24+
for(i = 0; i < files.length; i++) {
25+
file = files[i];
26+
errorFile = path.join(path.dirname(file), 'error');
2527

26-
try {
27-
if (fs.statSync(errorFile)) continue;
28-
} catch (e) { }
28+
try {
29+
if (fs.statSync(errorFile)) continue;
30+
} catch (e) { }
2931

30-
contents = fs.readFileSync(file, { encoding: 'utf8' });
31-
scss.tokenize(contents);
32-
}
32+
contents = fs.readFileSync(file, { encoding: 'utf8' });
33+
scss.tokenize(contents);
34+
}
35+
}).timeout(15000);
36+
});

0 commit comments

Comments
 (0)