How should I test if a component is defined in declarations of the SharedModule in Angular?

Viewed 21

I want to write a test with Karma in Angular for a module that checks the existence of @NgModule declarations properties. this is my SharedModule:

import { NgModule } from '@angular/core';
import { NavigationHeaderComponent } from './navigation-header/navigation-header.component';


@NgModule({
  declarations: [
    NavigationHeaderComponent
  ],
  imports: [
  ],
  exports: [

  ]
})
export class SharedModule { }

and I want to check NavigationHeaderComponent exist or not in declarations with a spec.ts test file. How can I do this?

0 Answers
Related