VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /usr/local/lib/node_modules/browserify/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/node_modules/browserify/test/full_paths.js
var unpack = require('browser-unpack');
var browserify = require('../');
var test = require('tap').test;
var vm = require('vm');
var path = require('path');

var deps = [
    path.join(__dirname, '/entry/main.js'),
    path.join(__dirname, '/entry/one.js'),
    path.join(__dirname, '/entry/two.js')
];

test('fullPaths enabled', function (t) {
    t.plan(3);

    var b = browserify({
        entries: [ deps[0] ],
        fullPaths: true
    });

    b.bundle(function (err, src) {
        unpack(src).forEach(function(dep) {
            t.notEqual(deps.indexOf(dep.id), -1, 'full path name for dep.id');
        });
    });
});

test('fullPaths disabled', function (t) {
    t.plan(3);

    var b = browserify({
        entries: [ deps[0] ],
        fullPaths: false
    });

    b.bundle(function (err, src) {
        unpack(src).forEach(function(dep) {
            t.equal(deps.indexOf(dep.id), -1, 'full path name no longer available');
        });
    });
});

test('fullPaths enabled, with custom exposed dependency name', function (t) {
    t.plan(1);

    var b = browserify({
        entries: [__dirname + '/entry/needs_three.js'],
        fullPaths: true
    });

    b.require(__dirname + '/entry/three.js', { expose: 'three' });

    b.bundle(function (err, src) {
        t.doesNotThrow(function () {
            vm.runInNewContext(src, { console: console, t: t });
        });
    });
});

VaKeR 2022