CUSTOM_ELEMENTS_SCHEMA error occur while unit testing with jasmine and karma

The solution for “CUSTOM_ELEMENTS_SCHEMA error occur while unit testing with jasmine and karma” can be found here. The following code will assist you in solving the problem.

import { TestBed, async } from ‘@angular/core/testing’;
import { AppComponent } from ‘./../app.component’;
import { RouterTestingModule } from ‘@angular/router/testing’;
import { CUSTOM_ELEMENTS_SCHEMA } from ‘@angular/core’;

describe(‘AppComponent’, () => {
beforeEach(() => {
TestBed.configureTestingModule({
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
declarations: [AppComponent],
imports: [RouterTestingModule]
});
TestBed.compileComponents();
});

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in