![]() 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 : |
var browserify = require('../'); var test = require('tap').test; var vm = require('vm'); var path = require('path'); test('ignore', function (t) { t.plan(1); var b = browserify(); b.add(__dirname + '/ignore/main.js'); b.ignore(path.join(__dirname, 'ignore/skip.js')); b.bundle(function (err, src) { if (err) t.fail(err); vm.runInNewContext(src, { t: t }); }); }); test('ignore array', function(t) { t.plan(2); var b = browserify(); b.add(__dirname + '/ignore/array.js'); b.ignore([ path.join(__dirname, 'ignore/skip.js'), path.join(__dirname, 'ignore/skip2.js') ]); b.bundle(function (err, src) { if (err) { t.fail(err); } vm.runInNewContext(src, { t: t }); }); }); test('ignore by package or id', function (t) { t.plan(3); var b = browserify(); b.add(__dirname + '/ignore/by-id.js'); b.ignore('events'); b.ignore('beep'); b.ignore('bad id'); b.bundle(function (err, src) { if (err) t.fail(err); vm.runInNewContext(src, { t: t }); }); }); test('ignore files referenced by relative path', function (t) { // Change the current working directory relative to this file var cwd = process.cwd(); process.chdir(__dirname); t.plan(1); var b = browserify(); b.add(__dirname + '/ignore/by-relative.js'); b.ignore('./ignore/ignored/skip.js'); b.bundle(function (err, src) { if (err) t.fail(err); vm.runInNewContext(src, { t: t }); }); // Revert CWD process.chdir(cwd); }); test('do not ignore files with relative paths that do not resolve', function (t) { // Change the current working directory to the ignore folder var cwd = process.cwd(); process.chdir(__dirname + '/ignore'); t.plan(2); var b = browserify(); b.add(__dirname + '/ignore/double-skip.js'); b.ignore('./skip.js'); b.bundle(function (err, src) { if (err) t.fail(err); vm.runInNewContext(src, { t: t }); }); // Revert CWD process.chdir(cwd); });