refactoring
This commit is contained in:
@@ -21,7 +21,7 @@ function fakeElement({ width = 320, height = 120 } = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
function loadEditorFactory() {
|
||||
async function loadEditorFactory() {
|
||||
global.Element = class Element {};
|
||||
global.document = {
|
||||
currentScript: null,
|
||||
@@ -30,12 +30,12 @@ function loadEditorFactory() {
|
||||
createElement: () => fakeElement()
|
||||
};
|
||||
global.window = { Cmap: null };
|
||||
require("../static/cmap/cmap-racket-wiki.js");
|
||||
await import("../static/cmap/cmap-racket-wiki.js");
|
||||
return global.window.RacketWikiCmap;
|
||||
}
|
||||
|
||||
test("automatic render sizing advances only an unchanged saved baseline", () => {
|
||||
const factory = loadEditorFactory();
|
||||
test("automatic render sizing advances only an unchanged saved baseline", async () => {
|
||||
const factory = await loadEditorFactory();
|
||||
const canvas = {
|
||||
addEventListener() {},
|
||||
querySelector: () => null,
|
||||
|
||||
Reference in New Issue
Block a user