Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!