stubs.js 535 B

123456789101112131415161718192021222324252627
  1. import sinon from 'sinon'
  2. export function stubUIConfig() {
  3. window.uiConfig = {
  4. chatMessageBorderSaturation: '85%',
  5. chatMessageBorderLightness: '40%',
  6. chatMessageBgSaturation: '85%',
  7. chatMessageBgLightness: '40%'
  8. }
  9. }
  10. export function tearDownUIConfigStubs() {
  11. delete window.uiConfig
  12. }
  13. export function stubMathJax() {
  14. window.MathJax = {
  15. Hub: {
  16. Queue: sinon.stub(),
  17. config: { tex2jax: { inlineMath: [['$', '$']] } }
  18. }
  19. }
  20. }
  21. export function tearDownMathJaxStubs() {
  22. delete window.MathJax
  23. }