Running testcase for a single component in angular with nx monorepo gives errors in other...

Discussão em 'Angular' iniciado por Edison Augusthy, Fevereiro 19, 2025.

  1. I have a set of testcases for a component called ForgotPasswordComponent. This component located inside modules/pages/forgot-password folder.

    [​IMG]

    When ever i try to run testcases for this file, the NX is giving errors from another files from another modules (like libs/shared/styled-components/priority-icon.component.ts) and most of these are typescript lint errors. so far i have tried below commands but it all gave same errors

    • npx jest modules/auth/src/lib/pages/forgot-password/forgot-password.component.spec.ts
    • npx nx run auth:test --testFile=forgot-password.component.spec.ts
    • npx nx test auth —include=modules/auth/src/lib/pages/forgot-password/forgot-password.component.spec.ts
    • npx nx run auth:test --testFile=forgot-password.component.spec.ts

    How can i avoid getting these lint erros and run test for a single file in angular nx mono repo ..?

    Continue reading...

Compartilhe esta Página