(src: string)
| 144 | } |
| 145 | |
| 146 | function vueHarness(src: string): string { |
| 147 | // Use vue3-sfc-loader to render a .vue single-file component straight from source text. |
| 148 | const head = `<script src="${CDN.vue}"></script><script src="${CDN.vueSfc}"></script>`; |
| 149 | const body = |
| 150 | `<div id="__art_root"></div>` + |
| 151 | `<script>\n` + |
| 152 | `const sfcSource = ${JSON.stringify(src)};\n` + |
| 153 | `const options = {\n` + |
| 154 | ` moduleCache: { vue: Vue },\n` + |
| 155 | ` getFile: () => sfcSource,\n` + |
| 156 | ` addStyle: (t) => { const s = document.createElement('style'); s.textContent = t; document.head.appendChild(s); },\n` + |
| 157 | `};\n` + |
| 158 | `const { loadModule } = window['vue3-sfc-loader'];\n` + |
| 159 | `Vue.createApp(Vue.defineAsyncComponent(() => loadModule('artifact.vue', options))).mount('#__art_root');\n` + |
| 160 | `</script>`; |
| 161 | return htmlShell(body, head); |
| 162 | } |
| 163 | |
| 164 | function markdownHarness(src: string): string { |
| 165 | const head = `<script src="${CDN.marked}"></script>`; |
no test coverage detected