Move test helpers into common modules (#1318)

* Move test helpers into common modules

* helpers.js gets all the helper functions
* setup.js gets the common Jest setup (serializer, expect extensions)

* Exclude test from coverage testing

* @ylemkimon's comments: parsing -> building, settings || defaultSettings

* Default argument for settings

* Fix lint errors

* @ylemklemon's comment: use buildAndSetResult

* Use template literals
This commit is contained in:
Erik Demaine
2018-05-18 09:45:19 -04:00
committed by GitHub
parent 4a3d6a526f
commit 7b22eeb64a
7 changed files with 308 additions and 392 deletions

View File

@@ -32,7 +32,16 @@ exports[`A parser that does not throw on unsupported commands should build katex
}
`;
exports[`A parser that does not throw on unsupported commands should properly escape LaTeX in errors 1`] = `"<span class=\\"katex-error\\" title=\\"ParseError: KaTeX parse error: Expected group after &#x27;^&#x27; at position 2: 2^̲&amp;&quot;&lt;&gt;\\" style=\\"color:#933\\">2^&amp;&quot;&lt;&gt;</span>"`;
exports[`A parser that does not throw on unsupported commands should properly escape LaTeX in errors 1`] = `
<span class="katex-error"
title="ParseError: KaTeX parse error: Expected group after &#x27;^&#x27; at position 2: 2^̲&amp;&quot;&lt;&gt;"
style="color:#933"
>
2^&amp;&quot;&lt;&gt;
</span>
`;
exports[`An implicit group parser within optional groups should work style commands \\sqrt[\\textstyle 3]{x} 1`] = `
[