Skip to content

Commit

Permalink
fix error_marker test
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed Feb 15, 2023
1 parent ae92532 commit ac76b58
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/ext/error_marker_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -31,7 +38,7 @@ module.exports = {
if (editor) {
editor.destroy();
editor.container.remove();
editor = textarea = null;
editor = null;
}
},
"test: simple text input": function() {
Expand Down
11 changes: 9 additions & 2 deletions src/virtual_renderer_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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");
Expand Down Expand Up @@ -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 = [
Expand Down

0 comments on commit ac76b58

Please sign in to comment.