stubs.ts 333 B

123456789101112131415
  1. import sinon from 'sinon'
  2. export function stubMathJax() {
  3. window.MathJax = {
  4. Hub: {
  5. Queue: sinon.stub(),
  6. config: { tex2jax: { inlineMath: [['$', '$']] } },
  7. },
  8. }
  9. }
  10. export function tearDownMathJaxStubs() {
  11. // @ts-expect-error - this is a stub that we're setting ourselves per test
  12. delete window.MathJax
  13. }