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 = fs.readFileSync(__dirname + '/files/right_hand.js');
5
6
test('globals on the right-hand of assignment', function (t) {
7
t.plan(3);
8
9
var scope = detect(src);
10
t.same(
11
scope.globals.implicit.sort(),
12
[ 'exports', '__dirname', '__filename' ].sort()
13
);
14
t.same(scope.globals.exported, []);
15
t.same(scope.locals, { '': [] });
16
});
17
18