kopia lustrzana https://github.com/c9/core
fix config test
rodzic
6b16562f97
commit
b6fe30715a
|
@ -6,13 +6,14 @@
|
||||||
|
|
||||||
|
|
||||||
require("amd-loader");
|
require("amd-loader");
|
||||||
require("c9/setup_paths")
|
require("c9/setup_paths");
|
||||||
require("c9/inline-mocha")(module);
|
require("c9/inline-mocha")(module);
|
||||||
|
|
||||||
var assert = require("assert");
|
var assert = require("assert");
|
||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
|
var Module = require("module");
|
||||||
|
|
||||||
describe("client config consistency", function(){
|
describe("client config consistency", function() {
|
||||||
// this.timeout(60000);
|
// this.timeout(60000);
|
||||||
|
|
||||||
var fileCache = Object.create(null);
|
var fileCache = Object.create(null);
|
||||||
|
@ -51,6 +52,15 @@ describe("client config consistency", function(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function resolveModulePath(base, packagePath) {
|
||||||
|
return Module._resolveFilename(packagePath, {
|
||||||
|
paths: Module._nodeModulePaths(base),
|
||||||
|
filename: base,
|
||||||
|
id: base,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function checkConfig(name, clientOptions, next) {
|
function checkConfig(name, clientOptions, next) {
|
||||||
var hasError = false;
|
var hasError = false;
|
||||||
var configPath = root + "/configs/" + name;
|
var configPath = root + "/configs/" + name;
|
||||||
|
@ -75,8 +85,7 @@ describe("client config consistency", function(){
|
||||||
filePath = require.resolve(p.packagePath.replace(/^plugins\//, ""));
|
filePath = require.resolve(p.packagePath.replace(/^plugins\//, ""));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// TODO instead of quessing we need a simple way of getting pathmap
|
// TODO instead of quessing we need a simple way of getting pathmap
|
||||||
if (configPath != configPathReal)
|
filePath = resolveModulePath(configPathReal, p.packagePath.replace(/^plugins\//, ""));
|
||||||
filePath = require.resolve(configPathReal + "/../../node_modules/" + p.packagePath.replace(/^plugins\//, ""));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!filePath.match(/\.js$/))
|
if (!filePath.match(/\.js$/))
|
||||||
|
|
Ładowanie…
Reference in New Issue