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

192
Vistas
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
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