Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80540 views
1
var test = require('tape');
2
var detect = require('../');
3
var fs = require('fs');
4
var src = '#!/beep/boop blah\n'
5
+ fs.readFileSync(__dirname + '/files/detect.js')
6
;
7
8
test('shebangs', function (t) {
9
t.plan(3);
10
11
var scope = detect(src);
12
t.same(scope.globals.implicit, [
13
'w', 'foo', 'process', 'console', 'AAA', 'BBB', 'CCC', 'xyz'
14
]);
15
t.same(scope.globals.exported, [
16
'w', 'RAWR', 'BLARG', 'ZZZ'
17
]);
18
t.same(scope.locals[''], [ 'x', 'y', 'z', 'beep' ]);
19
});
20
21