MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / createEditor

Function createEditor

src/test/editor.tests.js:19–33  ·  view source on GitHub ↗
(doc = "", extensions = [])

Source from the content-addressed store, hash-verified

17 const runner = new TestRunner("CodeMirror 6 Editor Tests");
18
19 function createEditor(doc = "", extensions = []) {
20 const container = document.createElement("div");
21 container.style.width = "500px";
22 container.style.height = "300px";
23 container.style.backgroundColor = "#1e1e1e";
24 document.body.appendChild(container);
25
26 const state = EditorState.create({
27 doc,
28 extensions: [...createBaseExtensions(), ...extensions],
29 });
30
31 const view = new EditorView({ state, parent: container });
32 return { view, container };
33 }
34
35 async function withEditor(test, fn, initialDoc = "", extensions = []) {
36 let view, container;

Callers 2

withEditorFunction · 0.70
runCodeMirrorTestsFunction · 0.70

Calls 2

createBaseExtensionsFunction · 0.85
createMethod · 0.65

Tested by

no test coverage detected