Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

364
Vistas
Lottie mocking is not working in react-testing-library

When I tried to run test cases I am getting the following error:

TypeError: Cannot set property 'fillStyle' of null
for line: import Lottie from 'react-lottie';

Can someone please help how to mock this library? I have also added 'jest-canvas-mock' library and added the below configuration in the jest.config.ts:

import type { Config } from '@jest/types';

// Sync object
const config: Config.InitialOptions = {
  verbose: true,
  setupFiles: ['jest-canvas-mock']
};
export default config;

Versions of the packages used:

react: 17.0.2
react-testing-library: 11.2.7
react-lottie: 1.2.3
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda