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

190
Views
How to test source code produced by a compiler/transpiler

I am working on a compiler that generates JavaScript modules and their associated type declarations: it takes one source with a specific grammar and output 3 different files:

  1. a ESM implementation
  2. a CJS implementation
  3. A type declaration

Those files export a class with a bunch of methods (that's an example of the type definition that's being generated):

export default class MyClass extends Base {
  myApi1(): Promise<void>;
  getFoo(): Promise<string>;
  // ...
}

All those files are generated by the compiler itself and I am wondering what would good testing strategies to satisfy the following criteria:

  • JS modules are valid JS files
  • The type declaration is a valid TS file
  • All files don't have extra/missing imports
  • That the generated types are corrects (methods have correct arg and return types)
  • Tests can be run in CI and be as fast as possible
  • Tests are as reliable as possible

More broadly my question is how to test generated files from a compiler/transpiler when those aren't bytecode?

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!