Skip to content

Commit b8af7e5

Browse files
committed
rewrite syntax test using falafel (instead of jshint)
1 parent 80563be commit b8af7e5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/syntax_test.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var path = require('path');
22
var fs = require('fs');
33

4-
var jshint = require('jshint').JSHINT;
4+
var falafel = require('falafel');
55
var glob = require('glob');
66

77
var constants = require('../tasks/util/constants');
@@ -14,19 +14,16 @@ glob(path.join(constants.pathToJasmineTests, '**/*.js'), function(err, files) {
1414
files.forEach(function(file) {
1515
var code = fs.readFileSync(file, 'utf-8');
1616

17-
jshint(code);
18-
19-
var impliedGlobals = jshint.data().implieds;
20-
21-
impliedGlobals.forEach(function(obj) {
22-
if(focusGlobals.indexOf(obj.name) !== -1) {
17+
falafel(code, {locations: true}, function(node) {
18+
if(node.type === 'Identifier' && focusGlobals.indexOf(node.name) !== -1) {
2319
logs.push([
2420
path.basename(file),
25-
'[line ' + obj.line + '] :',
21+
'[line ' + node.loc.start.line + '] :',
2622
'contains either a *fdescribe* or a *fit* block.'
2723
].join(' '));
2824
}
2925
});
26+
3027
});
3128

3229
if(logs.length) throw new Error(logs.join('\n'));

0 commit comments

Comments
 (0)