document.compatMode = 'BackCompat' is set on the environment of Jest.
So, I always see this warning when testing with Jest.(I'm using renderToString function only.)
Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.
It is quite annoying for me. Is there any way to ignore?
I'm only including the library without rendering a component in a test, and it still displays this warning in every single test. Can this console.warn just be removed, please?
Looks like @edemaine is dealing with the actual bug in jest, but I just wanted to chime in and say that a significant number of reports about KaTeX's rendering failed is caused by people not using a suitable doctype. So I'd be hesitant to remove it!
@xymostech I think just adding one option, like ignoreCompatModeWarning (false by default), would fix this...
Adding a warning toggle seems reasonable; I can imagine various situations where the caller doesn't want console messages. There are also the "No character metrics" warnings. Would it make sense to have a global warnings setting that defaults to true, and use that? If so, I can do a PR.
@edemaine would setting the warnings option to false disable all error reporting?
@kevinbarabash That's what I was imagining... though I'm not sure exactly what's best here. Presumably these tests are testing functionality other than KaTeX, so all KaTeX-related warnings would be annoying...
I realize a problem with my suggestion: the quirks mode test is currently done at the top level of katex.js, not when calling render. That early, there wouldn't be an options object to check for a warnings: false setting. What do you think about moving the warning into the first call to render (and maybe also __parse...?).
@Rokt33r @pyramation Would you be willing to try this slightly tweaked version of Jest to confirm that it removes the KaTeX warning? I'm not very familiar with Jest, so it's tricky for me to actually test, but discussion on https://github.com/facebook/jest/issues/3299 suggests that this will fix it. If it works, I'll submit it as a PR to Jest.
@edemaine
How could I install this?
@Rokt33r git clone [email protected]:edemaine/jest.git
@Rokt33r I just merged https://github.com/Khan/KaTeX/pull/608. Can you verify that that solves this issue?
I actually have no idea how should I install the unpublished code. Should I clone and install it manually?
@Rokt33r you'd have to clone the KaTeX repo and run make build and copy the built files to your project.
I've tried just now, but still got same warning.

@Rokt33r thanks for trying. I'm sorry, I forgot to mention that I rolled back the change change that removed the warning for quirks mode b/c the proposed fix didn't produce acceptable renderings. The plan is to enable the fix for limited quirks mode while continuing to warn in full quirks mode. See https://github.com/Khan/KaTeX/pull/778 for details.
I see. Now, I know how to do try. Just ping me again when you ready.
It appears that @edemaine proposed change to jest has made its way onto jest/master (see https://github.com/facebook/jest/commit/fcf64d79a67a64192660d3a8821a68f3507d661e) so I think this can be closed.
@Rokt33r please re-open if upgrading jest to v21.1.0 or greater doesn't solve the issue.
@kevinbarabash I'm still seeing this waring on jest v21.1.0