Skip to content
Browse files

Fixing tests

  • Loading branch information...
1 parent cad4f56 commit b7c10f31217060d906131baa66f4877ac601864e @zefhemel zefhemel committed May 4, 2012
View
5 plugins-client/ext.jslanguage/narcissus_jshint_test.js
@@ -1,7 +1,6 @@
if (typeof process !== "undefined") {
- require("../../../support/paths");
- require.paths.unshift(__dirname + "/../..");
- require.paths.unshift(__dirname + "/../../../support/treehugger/lib");
+ require("amd-loader");
+ require("../../test/setup_paths");
}
define(function(require, exports, module) {
View
9 plugins-client/ext.jslanguage/scope_analyzer_test.js
@@ -1,13 +1,12 @@
if (typeof process !== "undefined") {
- require("../../../support/paths");
- require.paths.unshift(__dirname + "/../..");
- require.paths.unshift(__dirname + "/../../../support/treehugger/lib");
+ require("amd-loader");
+ require("../../test/setup_paths");
}
define(function(require, exports, module) {
-var assert = require("ace/test/assertions");
-var LanguageWorker = require('ext/language/worker').LanguageWorker;
+var assert = require("assert");
+var LanguageWorker = require('../ext.language/worker').LanguageWorker;
var EventEmitter = require("ace/lib/event_emitter").EventEmitter;
module.exports = {
View
17 test/setup_paths.js
@@ -0,0 +1,17 @@
+var module = require("module");
+var oldResolve = module._resolveFilename;
+var extraPaths = [
+ __dirname + "/../node_modules/ace/lib",
+ __dirname + "/../node_modules/treehugger/lib",
+ __dirname + "/../plugins-client",
+];
+module._resolveFilename = function(request, paths) {
+ // Ensure client extensions can be loaded
+ request = request.replace(/^ext\//, "ext.");
+ // Add the extra paths
+ extraPaths.forEach(function(p) {
+ if(paths.paths.indexOf(p) === -1)
+ paths.paths.push(p);
+ });
+ return oldResolve(request, paths);
+}

0 comments on commit b7c10f3

Please sign in to comment.
Something went wrong with that request. Please try again.