Skip to content

Commit f89321d

Browse files
committed
chore: update web-test-runner configuration to include CodeMirror scripts
- Added a custom HTML template for the test runner to load CodeMirror scripts in the correct order before executing tests. - This enhancement ensures that the necessary CodeMirror modes and addons are available during testing, improving test reliability.
1 parent 13e3a90 commit f89321d

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

web-test-runner.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
export default {
22
files: "test/**/*.test.js",
33
nodeResolve: true,
4+
// Load CodeMirror files in the correct order before running tests
5+
testRunnerHtml: (testFramework) =>
6+
`<html>
7+
<head>
8+
<script src="/node_modules/codemirror/lib/codemirror.js"></script>
9+
<script src="/node_modules/codemirror/addon/mode/loadmode.js"></script>
10+
<script src="/node_modules/codemirror/mode/meta.js"></script>
11+
<script src="/node_modules/codemirror/mode/javascript/javascript.js"></script>
12+
<script src="/node_modules/codemirror/mode/xml/xml.js"></script>
13+
<script src="/node_modules/codemirror/mode/htmlmixed/htmlmixed.js"></script>
14+
<script src="/node_modules/codemirror/mode/markdown/markdown.js"></script>
15+
<script src="/node_modules/codemirror/addon/lint/lint.js"></script>
16+
<script src="/node_modules/codemirror/addon/lint/json-lint.js"></script>
17+
</head>
18+
<body>
19+
<script type="module" src="${testFramework}"></script>
20+
</body>
21+
</html>`,
422
middleware: [
523
function rewriteBase(context, next) {
624
if (context.url.indexOf("/base") === 0) {

0 commit comments

Comments
 (0)