Skip to content

Commit 3837e80

Browse files
committed
Add diagnostics test to try to replicate what I'm seeing locally
1 parent 51c093d commit 3837e80

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

test-packages/package-test-core/__tests__/language-server/diagnostics.test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,4 +636,37 @@ describe('Language Server: Diagnostics (ts plugin)', () => {
636636
]
637637
`);
638638
});
639+
640+
test('MathML context is retained and popped', async () => {
641+
let componentA = stripIndent`
642+
export const MathMLExample = <template>
643+
<span>x</span>
644+
645+
<math display="block">
646+
<mfrac>
647+
<mrow>
648+
<mi>a</mi>
649+
<mo>+</mo>
650+
<mn>2</mn>
651+
</mrow>
652+
<mrow>
653+
<mn>3</mn>
654+
<mo>−</mo>
655+
<mi>b</mi>
656+
</mrow>
657+
</mfrac>
658+
</math>
659+
660+
<span>x</span>
661+
</template>
662+
`;
663+
664+
const diagnostics = await requestDiagnostics(
665+
'ts-template-imports-app/src/ephemeral-index.gts',
666+
'glimmer-ts',
667+
componentA,
668+
);
669+
670+
expect(diagnostics).toMatchInlineSnapshot(`[]`);
671+
});
639672
});

test-packages/ts-template-imports-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@glint/environment-ember-loose": "workspace:*",
3131
"@glint/environment-ember-template-imports": "workspace:*",
3232
"@glint/template": "workspace:*",
33+
"@glint/tsserver-plugin": "workspace:*",
3334
"@glint/core": "workspace:*",
3435
"@types/rsvp": "^4.0.9",
3536
"@glint/tsserver-plugin": "workspace:*",

test-packages/ts-template-imports-app/src/math-ml.gts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<template>
1+
export const MathMLExample = <template>
22
<math display="block">
33
<mfrac>
44
<mrow>

0 commit comments

Comments
 (0)