To allow any element add ‘NO_ERRORS_SCHEMA’ to the ‘@NgModule.schemas’ of this component. in Angular 4

In your test spec file it needs to be set up like this:

beforeEach(async(() => {
      declarations: [ yourcomponent ],
      schemas: [NO_ERRORS_SCHEMA]

Notice the schemas property in the TestBed.configureTestingModule method. After setting the schemas property your tests should run without error as before you added Font Awsome component.

Leave a Comment