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

241
Vistas
Include js files for typescript tests

I am working on client-only app, which is implemented as an html page with the "backend" (engine of the application) written in javascript, and UI implemented in React+typescript.

The solution two main folders are 'src' and 'public'. Folder 'src' contains typescript sources, files from src folder are compiled (transpiled) + minimized/obfuscated. Folder 'public' contains index.html file and 'backend' js files. JS files don't get compiled due to specific eval-dependent implementation of the backend.

UI part of the application (ts) depends on the backend (js). JS classes are available for use in runtime.

The problem I have faced is problem with creating "integration" tests using jest: I cannot load my js files before tests execution.

I tried to tune jest configuration to include the needed js files, but didn't succeed.

"jest": { "setupFilesAfterEnv": ["/public/engine.js"] }

During runtime of tests I get errors about missing class definitions (the ones which should come from js file).

How can I solve this problem?

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