Running NX mono repo and Angular
"@nrwl/angular": "15.2.4",
"@angular/core": "~15.0.0",
"@ngxs/store": "^3.7.6",
"jest": "28.1.1",
"@nrwl/jest": "15.2.4",
The exciting part is, the component I am testing has nothing to do with Ngxs and spec file is simple.
describe('OperationPlanTaskFormComponent', () => {
let component: OperationPlanTaskFormComponent;
let fixture: ComponentFixture<OperationPlanTaskFormComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [OperationPlanTaskFormComponent],
imports: [
ButtonModule,
ConfirmDialogModule,
]
}).compileComponents();
fixture = TestBed.createComponent(OperationPlanTaskFormComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
So, when I run test file for this it shows error "NgxsFeatureModule does not have a module def (ɵmod property)"
Tried deleting node_modules
folder and clean install with npm ci
. Tried delete .angular
and including the cache. Even tried nx reset
. No luck. I am sure that the component I am trying to test doesn't have any dependency which can cause this issue.
I would really appreciate if anyone has any idea about what is actually going on.