(doc = "", extensions = [])
| 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; |
no test coverage detected