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

869
Views
Angular 13 + broma + biblioteca Angular no funciona

Estoy tratando de usar broma en un proyecto Angular 13 para probar. Uso jest-preset-angular con @angular-builders/jest.

Uso ngx-pipes, que es una biblioteca que no está compilada para Angular 13. Funciona bien durante la compilación Angular normal. Pero en la ejecución de la prueba de broma, provoca el error:

 Error: Unexpected value 'NgStringPipesModule2' imported by the module 'DynamicTestModule'. Please add an @NgModule annotation.

Reproducción mínima: https://github.com/dhcode/jest-preset-angular-13-issue

En mi proyecto real, también tengo el mismo error con otras bibliotecas angulares. Ejecuté ng serve antes, por lo que la compilación ngcc se realizó antes de ejecutar las pruebas.

¿Cómo puedo hacer que mis pruebas se ejecuten y reconozcan las bibliotecas externas que se han creado con una versión anterior de Angular?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Por lo que parece, ngx-pipes aún no publica una distribución de Ivy y su proyecto aún necesita ngcc antes de ejecutar las pruebas.

 // package.json { "scripts": { "test": "ngcc && ng test" } }
 > jest-tests@0.0.0 test > ngcc && ng test Processing legacy "View Engine" libraries: - ngx-pipes [fesm2015/esm2015] (https://github.com/danrevah/ngx-pipes.git) - ngx-pipes [esm2015/esm2015] (https://github.com/danrevah/ngx-pipes.git) - ngx-pipes [main/umd] (https://github.com/danrevah/ngx-pipes.git) Encourage the library authors to publish an Ivy distribution. PASS src/app/app.component.spec.ts AppComponent ✓ should create the app (163 ms) ✓ should have as title 'jest-tests' (46 ms) ✓ should render title (44 ms) ✓ should render shortened text (33 ms) -------------------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s -------------------|---------|----------|---------|---------|------------------- All files | 100 | 100 | 100 | 100 | ...component.html | 100 | 100 | 100 | 100 | app.component.ts | 100 | 100 | 100 | 100 | -------------------|---------|----------|---------|---------|------------------- Test Suites: 1 passed, 1 total Tests: 4 passed, 4 total Snapshots: 0 total Time: 3.526 s, estimated 5 s Ran all test suites.
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!