Initial commit

This commit is contained in:
abrendan
2023-11-30 14:15:19 +00:00
commit e4599df811
5457 changed files with 500139 additions and 0 deletions

43
node_modules/app-module-path/test/.jshintrc generated vendored Normal file
View File

@@ -0,0 +1,43 @@
{
"predef": [
"it",
"xit",
"console",
"describe",
"xdescribe",
"beforeEach",
"before",
"after",
"waits",
"waitsFor",
"runs"
],
"node" : true,
"es5" : false,
"esnext": true,
"browser" : true,
"boss" : false,
"curly": false,
"debug": false,
"devel": false,
"eqeqeq": true,
"evil": true,
"forin": false,
"immed": true,
"laxbreak": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": true,
"nomen": false,
"onevar": false,
"plusplus": false,
"regexp": false,
"undef": true,
"sub": false,
"white": false,
"eqeqeq": false,
"latedef": true,
"unused": "vars",
"eqnull": true
}

View File

@@ -0,0 +1,3 @@
exports.getFoo = function() {
return require('installed-module-allowed-explicit-foo');
};

View File

@@ -0,0 +1 @@
exports.name = 'installed-module-allowed-explicit-foo';

View File

@@ -0,0 +1,5 @@
require('../../../register');
exports.getFoo = function() {
return require('installed-module-allowed-foo');
};

View File

@@ -0,0 +1 @@
exports.name = 'installed-module-allowed-foo';

View File

@@ -0,0 +1,16 @@
exports.sayHello = function() {
console.log('Hello from installed module');
var moduleA;
try {
moduleA = require('module-a');
}
catch(e) {
console.log('Not able to find module-a from ' + __filename + '... great!');
}
if (moduleA) {
throw new Error('module-a should not have been found from ' + __filename + '!');
}
};

View File

@@ -0,0 +1,5 @@
exports.sayHello = function() {
throw new Error('this should not be required!');
};
exports.isLocal = true;

View File

@@ -0,0 +1,9 @@
var moduleB = require('module-b');
var installedModule = require('installed-module');
exports.sayHello = function() {
console.log('Hello from module-a');
moduleB.sayHello();
installedModule.sayHello();
};

View File

@@ -0,0 +1,3 @@
{
"main": "lib/index"
}

View File

@@ -0,0 +1,3 @@
exports.sayHello = function() {
console.log('Hello from module-b');
}

View File

@@ -0,0 +1,3 @@
exports.sayHello = function() {
console.log('Hello from module-c');
}

View File

@@ -0,0 +1,3 @@
exports.sayHello = function() {
console.log('Hello from module-d');
}

3
node_modules/app-module-path/test/src/package.json generated vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"name": "foo"
}

11
node_modules/app-module-path/test/test-helper-code.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
var path = require('path');
require('../').addPath(path.join(__dirname, 'src'));
// other common test setup, e.g.
// var chai = require("chai");
// var dirtyChai = require("dirty-chai");
// chai.use(dirtyChai);

13
node_modules/app-module-path/test/test.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
var path = require('path');
var assert = require('assert');
require('../').addPath(path.join(__dirname, 'src'));
require('module-a').sayHello();
require('module-b').sayHello();
require('installed-module').sayHello();
assert(require('installed-module.js').isLocal);
require('package.json');
console.log('All tests passed!');

37
node_modules/app-module-path/test/test2.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
var path = require('path');
var assert = require('assert');
var expect = require('chai').expect;
require('./test-helper-code.js');
describe("support for test code", function() {
it("should load up a module in a path defined in test helper code", function() {
require('module-a').sayHello();
require('module-b').sayHello();
});
it("should not search paths that have been removed", function() {
require('module-c').sayHello();
require('../').removePath(path.join(__dirname, 'src'));
assert.throws(function() {
require('module-d').sayHello();
});
});
it("should allow specific directory to be enabled", function() {
var targetDir = path.dirname(require.resolve('installed-module-allowed-explicit'));
require('../').addPath(targetDir);
require('../').enableForDir(targetDir);
var foo = require('installed-module-allowed-explicit').getFoo();
expect(foo.name).to.equal('installed-module-allowed-explicit-foo');
});
it("should allow directories where loaded", function() {
require('../').addPath(path.join(__dirname, 'src'));
var foo = require('installed-module-allowed').getFoo();
expect(foo.name).to.equal('installed-module-allowed-foo');
});
});
console.log('All tests passed!');