You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2:22:16PM-Filechangedetected.Startingincrementalcompilation...
tests/rendering/markdown-test.gts:140:35-errorTS0: Unclosedelement`pre`:
||<pre>|(erroroccurredin'an unknown module' @ line140 : column34)140test('with the plugin: no <pre> renders',asyncfunction(assert){2:22:16PM-Found1error.Watchingforfilechanges.
Line 140:
test('with the plugin: no <pre> renders',asyncfunction(assert){
the whole file
import{assertasdebugAssert}from'@ember/debug';import{render,setupOnerror}from'@ember/test-helpers';import{module,test}from'qunit';import{setupRenderingTest}from'ember-qunit';import{stripIndent}from'common-tags';import{compile}from'ember-repl';import{CACHE}from'ember-repl/__PRIVATE__DO_NOT_USE__';import{visit}from'unist-util-visit';importtype{ComponentLike}from'@glint/template';importtype{Parent}from'unist';module('Rendering | compile()',function(hooks){setupRenderingTest(hooks);module('markdown features',function(){test('tables',asyncfunction(assert){setupOnerror(()=>{assert.notOk('This should not error');});letsnippet=stripIndent` | Color | Food | | ---- | ---- | | red | apple | | yellow| banana | `;letcomponent: ComponentLike|undefined;awaitcompile(snippet,{format: 'glimdown',onSuccess: (comp)=>(component=comp),onError: ()=>assert.notOk('did not expect error'),onCompileStart: ()=>{/* not used */},});debugAssert(`[BUG]`,component);awaitrender(component);assert.dom('table').exists();assert.dom('td').containsText('red');});test('footnotes',asyncfunction(assert){setupOnerror(()=>{assert.notOk('This should not error');});letsnippet=stripIndent` text[^note] [^note]: a note about a thing `;letcomponent: ComponentLike|undefined;awaitcompile(snippet,{format: 'glimdown',onSuccess: (comp)=>(component=comp),onError: ()=>assert.notOk('did not expect error'),onCompileStart: ()=>{/* not used */},});debugAssert(`[BUG]`,component);awaitrender(component);assert.dom('sup').exists();assert.dom('a').exists({count: 2});// to and from the footnote});module('custom remark plugins',function(){module('demo: remove <pre> code',function(hooks){letsnippet=stripIndent` text \`\`\`js const two = 2; \`\`\` `;/** * Test plugin that just turns code into an * unformatted mess in a <p> tag */functionuncodeSnippet(/* options */){returnfunctiontransformer(tree: Parent){// eslint-disable-next-line @typescript-eslint/no-explicit-anyvisit(tree,['code'],function(node: any,index,parent){if(!parent)return;if(!index)return;parent.children[index]={type: 'html',value: `<p>${node.value}</p>`}});}}letbuild: (plugin: unknown)=>Promise<void>;letcomponent: ComponentLike|undefined;hooks.beforeEach(function(assert){CACHE.clear();component=undefined;build=asyncfunctionbuild(plugin){awaitcompile(snippet,{format: 'glimdown',remarkPlugins: plugin ? [plugin] : [],onSuccess: (comp)=>(component=comp),onError: ()=>assert.notOk('did not expect error'),onCompileStart: ()=>{/* not used */},});}});test('baseline: without the plugin, <pre> renders',asyncfunction(assert){debugAssert(`[BUG]`,build);awaitbuild();debugAssert(`[BUG]`,component);awaitrender(component);assert.dom('pre').exists();});test('with the plugin: no <pre> renders',asyncfunction(assert){debugAssert(`[BUG]`,build);awaitbuild(uncodeSnippet);debugAssert(`[BUG]`,component);awaitrender(component);// await this.pauseTest();assert.dom('pre').doesNotExist();});});});});});
I believe this'd be solved by: #615
The error:
Line 140:
the whole file
Changing
<pre>
topre
on 140 and 130 gives:I had another
<pre>
on 81, swapping that withpre
doesn't change anything.If I move
to the top of the module (
demo: remove pre code
), then I get this error:but that is in a comment!!!
Changing
<p>
top
then leaves me with this error:Even if I extract the type to the top of the file, now on line 14:
I get:
if I change the type to
then I can finally see an actual error in my test file! 🎉
The text was updated successfully, but these errors were encountered: