Error: StaticInjectorError[FormBuilder] when running ng test
Your test uses a testing angular module which only has a CreatearchiveComponent
, but doesn't import ReactiveFormsModule. So the FormBuilder service, provided by ReactiveFormsModule, is not available. You need to import the modules that are needed by the component under test:
TestBed.configureTestingModule({
declarations: [ CreatearchiveComponent ],
imports: [ReactiveFormsModule],
schemas: [NO_ERRORS_SCHEMA]
})