mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-12 13:41:40 +00:00
update
This commit is contained in:
37
node_modules/app-module-path/test/test2.js
generated
vendored
Normal file
37
node_modules/app-module-path/test/test2.js
generated
vendored
Normal 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!');
|
Reference in New Issue
Block a user