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