Sha256: a83507267eaef768873456da278e8a251a115fc00e344289aa3d219d5eb1c561

Contents?: true

Size: 1.69 KB

Versions: 9

Compression:

Stored size: 1.69 KB

Contents

var test = require('tap').test;
var detective = require('../');

var sources = [
    'require("a")',
    ';require("a")',
    ' require("a")',
    'void require("a")',
    '+require("a")',
    '!require("a")',
    '/*comments*/require("a")',
    '(require("a"))',

    'require/*comments*/("a")',
    ';require/*comments*/("a")',
    ' require/*comments*/("a")',
    'void require/*comments*/("a")',
    '+require/*comments*/("a")',
    '!require/*comments*/("a")',
    '/*comments*/require/*comments*/("a")',
    '(require/*comments*/("a"))',

    'require /*comments*/ ("a")',
    ';require /*comments*/ ("a")',
    ' require /*comments*/ ("a")',
    'void require /*comments*/ ("a")',
    '+require /*comments*/ ("a")',
    '!require /*comments*/ ("a")',
    ' /*comments*/ require /*comments*/ ("a")',
    '(require /*comments*/ ("a"))',

    'require /*comments*/ /*more comments*/ ("a")',
    ';require /*comments*/ /*more comments*/ ("a")',
    ' require /*comments*/ /*more comments*/ ("a")',
    'void require /*comments*/ /*more comments*/ ("a")',
    '+require /*comments*/ /*more comments*/ ("a")',
    '!require /*comments*/ /*more comments*/ ("a")',
    ' /*comments*/ /*more comments*/ require /*comments*/ /*more comments*/ ("a")',
    '(require /*comments*/ /*more comments*/ ("a"))',

    'require//comments\n("a")',
    ';require//comments\n("a")',
    ' require//comments\n("a")',
    'void require//comments\n("a")',
    '+require//comments\n("a")',
    '!require//comments\n("a")',
    '  require//comments\n("a")',
    '(require//comments\n("a"))'
];

test('complicated', function (t) {
    t.plan(sources.length);
    sources.forEach(function(src) {
        t.deepEqual(detective(src), [ 'a' ]);
    });
});

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/detective/test/complicated.js
minimum_viable_product-0.0.11 test/dummy/node_modules/detective/test/complicated.js
brwy_rails-0.0.6 test/dummy/node_modules/detective/test/complicated.js
brwy_rails-0.0.5 test/dummy/node_modules/detective/test/complicated.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/detective/test/complicated.js
brwy_rails-0.0.4 test/dummy/node_modules/detective/test/complicated.js
brwy_rails-0.0.3 test/dummy/node_modules/detective/test/complicated.js
brwy_rails-0.0.2 test/dummy/node_modules/detective/test/complicated.js
brwy_rails-0.0.1 test/dummy/node_modules/detective/test/complicated.js