diff --git a/src/ext/error_marker_test.js b/src/ext/error_marker_test.js index 97e0950a30b..27fe395ff37 100644 --- a/src/ext/error_marker_test.js +++ b/src/ext/error_marker_test.js @@ -9,10 +9,17 @@ if (typeof process !== "undefined") { var assert = require("./../test/assertions"); require("./../test/mockdom"); var ace = require("../ace"); -var editor, changes, textarea; +var editor, changes; module.exports = { setUp: function() { + ace.config.setLoader(function(moduleName, cb) { + if (moduleName == "ace/theme/textmate") + return cb(null, require("../theme/textmate")); + if (moduleName == "ace/ext/error_marker") + return cb(null, require("../ext/error_marker")); + return console.error("loader is not configured"); + }); if (!editor) { editor = ace.edit(null); document.body.appendChild(editor.container); @@ -31,7 +38,7 @@ module.exports = { if (editor) { editor.destroy(); editor.container.remove(); - editor = textarea = null; + editor = null; } }, "test: simple text input": function() { diff --git a/src/virtual_renderer_test.js b/src/virtual_renderer_test.js index d0754ab169e..88d18637eab 100644 --- a/src/virtual_renderer_test.js +++ b/src/virtual_renderer_test.js @@ -11,7 +11,6 @@ var EditSession = require("./edit_session").EditSession; var VirtualRenderer = require("./virtual_renderer").VirtualRenderer; var vim = require("./keyboard/vim"); var assert = require("./test/assertions"); -require("./ext/error_marker"); function setScreenPosition(node, rect) { node.style.left = rect[0] + "px"; @@ -23,6 +22,14 @@ function setScreenPosition(node, rect) { var editor = null; module.exports = { setUp: function() { + require("./config").setLoader(function(moduleName, cb) { + if (moduleName == "ace/theme/textmate") + return cb(null, require("./theme/textmate")); + if (moduleName == "ace/ext/error_marker") + return cb(null, require("./ext/error_marker")); + return console.error("loader is not configured"); + }); + if (editor) editor.destroy(); var el = document.createElement("div"); @@ -255,7 +262,7 @@ module.exports = { } ]); renderer.$loop._flush(); - var context = renderer.$scrollDecorator.canvas.getContext(); + var context = renderer.$scrollDecorator.canvas.getContext("2d"); var imageData = context.getImageData(0, 0, 50, 50); var scrollDecoratorColors = renderer.$scrollDecorator.colors.light; var values = [