setup.test.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * yongren-dashboard-ui setup测试
  3. * 验证测试环境配置是否正确
  4. */
  5. import '@testing-library/jest-dom'
  6. describe('yongren-dashboard-ui setup', () => {
  7. it('should have Taro environment variables set', () => {
  8. expect(process.env.TARO_ENV).toBe('h5')
  9. expect(process.env.TARO_PLATFORM).toBe('web')
  10. })
  11. it('should have MutationObserver mock', () => {
  12. expect(typeof global.MutationObserver).toBe('function')
  13. })
  14. it('should have IntersectionObserver mock', () => {
  15. expect(typeof global.IntersectionObserver).toBe('function')
  16. })
  17. it('should have ResizeObserver mock', () => {
  18. expect(typeof global.ResizeObserver).toBe('function')
  19. })
  20. it('should have matchMedia mock', () => {
  21. expect(typeof window.matchMedia).toBe('function')
  22. })
  23. it('should have getComputedStyle mock', () => {
  24. expect(typeof window.getComputedStyle).toBe('function')
  25. })
  26. it('should have getBoundingClientRect mock', () => {
  27. expect(typeof Element.prototype.getBoundingClientRect).toBe('function')
  28. })
  29. })