fix config test

pull/402/head
nightwing 2017-02-13 10:43:55 +00:00
rodzic 6b16562f97
commit b6fe30715a
2 zmienionych plików z 16 dodań i 7 usunięć

Wyświetl plik

@ -6,13 +6,14 @@
require("amd-loader");
require("c9/setup_paths")
require("c9/setup_paths");
require("c9/inline-mocha")(module);
var assert = require("assert");
var fs = require("fs");
var Module = require("module");
describe("client config consistency", function(){
describe("client config consistency", function() {
// this.timeout(60000);
var fileCache = Object.create(null);
@ -50,6 +51,15 @@ describe("client config consistency", function(){
fetchClientOptions(callback);
});
}
function resolveModulePath(base, packagePath) {
return Module._resolveFilename(packagePath, {
paths: Module._nodeModulePaths(base),
filename: base,
id: base,
});
}
function checkConfig(name, clientOptions, next) {
var hasError = false;
@ -75,8 +85,7 @@ describe("client config consistency", function(){
filePath = require.resolve(p.packagePath.replace(/^plugins\//, ""));
} catch (e) {
// TODO instead of quessing we need a simple way of getting pathmap
if (configPath != configPathReal)
filePath = require.resolve(configPathReal + "/../../node_modules/" + p.packagePath.replace(/^plugins\//, ""));
filePath = resolveModulePath(configPathReal, p.packagePath.replace(/^plugins\//, ""));
}
}
if (!filePath.match(/\.js$/))

6
node_modules/architect/architect.js wygenerowano vendored
Wyświetl plik

@ -88,9 +88,9 @@ if (typeof module === "object") (function () {
// This throws, make sure to wrap in try..catch
function resolvePackageSync(base, packagePath) {
return Module._resolveFilename(packagePath, {
paths: Module._nodeModulePaths(base),
filename: base + "/package.json",
id: base + "/package.json",
paths: Module._nodeModulePaths(base),
filename: base + "/package.json",
id: base + "/package.json",
});
}