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

618
Views
TypeError: Broma: una transformación debe exportar una función `proceso`

Recientemente actualicé mi aplicación a Angular 11. Jest se configuró como el marco de prueba predeterminado. La ejecución de la prueba npm da como resultado el siguiente error:

 ● Test suite failed to run TypeError: Jest: a transform must export a `process` function. 20 | @Component({ 21 | selector: 'app-bx-input-textbox', > 22 | template: require('./bx-input-textbox.component.html'), | ^ 23 | styles: [String(require('./bx-input-textbox.component.scss'))], 24 | providers: [ 25 | { at ScriptTransformer._getTransformer (node_modules/@jest/transform/build/ScriptTransformer.js:357:15) at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:419:28) at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:523:40) at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25) at src/app/core/components/bx-input-textbox/bx-input-textbox.component.ts:22:15 at Object.<anonymous> (src/app/core/components/bx-input-textbox/bx-input-textbox.component.ts:38:1)

// broma.config.js

 module.exports = { testEnvironment: "jsdom", transform: { ".+\\.(css|styl|less|sass|scss)$": "<rootDir>/node_modules/jest-css-modules-transform", "\\.(ts|js)$": ['ts-jest'] }, setupFilesAfterEnv: ['./jest.setup.js'], globals: { "ts-jest": { tsConfig: { // allow js in typescript allowJs: true, }, }, }, // If you need to test a specifc file just include it here //testMatch: ['**/repository.jobs.spec.ts'], testMatch: [] };

Versiones del paquete "@angular-builders/jest": "12.1.0", "@types/jest": "24.9.1", "ts-jest": "26.0.0", "jest": "24.9.0 ",

Probé diferentes configuraciones con el archivo jest.config.js pero no pude resolver este error. Cualquier sugerencia para resolver este problema sería útil.

over 4 years ago · Santiago Trujillo
5 answers
Answer question

0

su versión ts-jest debe coincidir con la versión de jest .

over 4 years ago · Santiago Trujillo Report

0

Es posible que también deba actualizar jest-cli , junto con jest & ts-jest .

over 4 years ago · Santiago Trujillo Report

0

Se encontró el mismo problema con "ts-jest": "^27.0.5" y se solucionó volviendo a "ts-jest": "^26.4.2"

over 4 years ago · Santiago Trujillo Report

0

Limpiar los módulos de nodo y la carpeta .jest finalmente se deshizo de esto.

 rm -rf ./node_modules && rm -rf .jest && yarn
over 4 years ago · Santiago Trujillo Report

0

Broma actualizada y ts-jest a v27 para solucionar este problema

over 4 years ago · Santiago Trujillo Report
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!