Sha256: 3702cf1af25df7eb2afd4911e50cd88fb647576dbd05b6ef4aa3a99084c925b9

Contents?: true

Size: 1.23 KB

Versions: 7

Compression:

Stored size: 1.23 KB

Contents

var test = require('tape');
var detect = require('../');
var fs = require('fs');
var src = {
    call: fs.readFileSync(__dirname + '/files/buffer_call.js'),
    isbuffer: fs.readFileSync(__dirname + '/files/buffer_isbuffer.js'),
    v: fs.readFileSync(__dirname + '/files/buffer_var.js')
};

test('implicit props: call', function (t) {
    t.plan(3);
    var scope = detect(src.call);
    t.deepEqual(scope.locals, { '': [] });
    t.deepEqual(scope.globals.implicit, [ 'console', 'Buffer' ]);
    t.deepEqual(scope.globals.implicitProperties, {
        console: [ 'log' ],
        Buffer: [ '()' ]
    })
});

test('implicit props: isBuffer', function (t) {
    t.plan(3);
    var scope = detect(src.isbuffer);
    t.deepEqual(scope.locals, { '': [] });
    t.deepEqual(scope.globals.implicit, [ 'console', 'Buffer' ]);
    t.deepEqual(scope.globals.implicitProperties, {
        console: [ 'log' ],
        Buffer: [ 'isBuffer' ]
    })
});

test('implicit props: var', function (t) {
    t.plan(3);
    var scope = detect(src.v);
    t.deepEqual(scope.locals, { '': [] });
    t.deepEqual(scope.globals.implicit, [ 'console', 'Buffer' ]);
    t.deepEqual(scope.globals.implicitProperties, {
        console: [ 'log' ],
        Buffer: [ '*' ]
    })
});

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
minimum_viable_product-0.0.11 test/dummy/node_modules/lexical-scope/test/props.js
brwy_rails-0.0.6 test/dummy/node_modules/lexical-scope/test/props.js
brwy_rails-0.0.5 test/dummy/node_modules/lexical-scope/test/props.js
brwy_rails-0.0.4 test/dummy/node_modules/lexical-scope/test/props.js
brwy_rails-0.0.3 test/dummy/node_modules/lexical-scope/test/props.js
brwy_rails-0.0.2 test/dummy/node_modules/lexical-scope/test/props.js
brwy_rails-0.0.1 test/dummy/node_modules/lexical-scope/test/props.js