1- import { afterAll , beforeEach , describe , test } from '@jest/globals' ;
2- import { getTokens , toXmlMatch , setupTexTypeset , typeset2mml , setupComponents } from '#helpers' ;
1+ import { afterAll , beforeEach , describe , expect , test } from '@jest/globals' ;
2+ import { getTokens , setupTexTypeset , typeset2mml , setupComponents } from '#helpers' ;
33
44setupComponents ( { loader : { load : [ 'input/tex-base' , '[tex]/autoload' ] } } ) ;
55
@@ -13,41 +13,11 @@ describe('Autoload', () => {
1313 /********************************************************************************/
1414
1515 test ( 'Autoload package' , async ( ) => {
16- toXmlMatch (
17- await typeset2mml ( '\\bbox[red]{x}' ) ,
18- `<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\bbox[red]{x}" display="block">
19- <mstyle mathbackground="red" data-latex="\\bbox [red]{x}">
20- <mi data-latex="x">x</mi>
21- </mstyle>
22- </math>`
23- ) ;
16+ expect ( await typeset2mml ( '\\bbox[red]{x}' ) ) . toMatchSnapshot ( ) ;
2417 } ) ;
2518
2619 test ( 'Autoload environment' , async ( ) => {
27- toXmlMatch (
28- await typeset2mml ( '\\begin{CD} a @>>> b\\end{CD}' ) ,
29- `<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\begin{CD} a @>>> b\\end{CD}" display="block">
30- <mtable columnspacing="5pt" rowspacing="5pt" displaystyle="true" data-latex="\\begin{CD} a @>>> b\\end{CD}">
31- <mtr>
32- <mtd>
33- <mi data-latex="a">a</mi>
34- <mpadded height="8.5pt" depth="2pt"></mpadded>
35- </mtd>
36- <mtd>
37- <mover>
38- <mo minsize="2.75em">→</mo>
39- <mpadded width="+.67em" lspace=".33em" voffset=".1em">
40- <mspace width="2.75em" linebreak="nobreak" data-latex="\\kern 2.75em"></mspace>
41- </mpadded>
42- </mover>
43- </mtd>
44- <mtd>
45- <mi data-latex="b">b</mi>
46- </mtd>
47- </mtr>
48- </mtable>
49- </math>`
50- ) ;
20+ expect ( await typeset2mml ( '\\begin{CD} a @>>> b\\end{CD}' ) ) . toMatchSnapshot ( ) ;
5121 } ) ;
5222} ) ;
5323
0 commit comments