Add imports and providers to enable basic testing

This commit is contained in:
Jesse Lucas
2020-04-05 11:50:05 -04:00
parent 3ee9bc097f
commit 236816cb93
14 changed files with 76 additions and 75 deletions
+12 -11
View File
@@ -1,24 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { async, TestBed } from '@angular/core/testing';
import { ChartComponent } from './chart.component';
import { HttpClientModule } from '@angular/common/http';
class MockService {
getAll() {
// unimplemented
}
};
describe('ChartComponent', () => {
let component: ChartComponent;
let fixture: ComponentFixture<ChartComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ChartComponent ]
})
.compileComponents();
imports: [HttpClientModule],
providers: [ChartComponent]
}).compileComponents();
component = TestBed.inject(ChartComponent);
}));
beforeEach(() => {
fixture = TestBed.createComponent(ChartComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
@@ -1,23 +1,19 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DonutChartComponent } from './donut-chart.component';
import { HttpClientModule } from '@angular/common/http';
describe('DonutChartComponent', () => {
let component: DonutChartComponent;
let fixture: ComponentFixture<DonutChartComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DonutChartComponent ]
})
.compileComponents();
}));
declarations: [DonutChartComponent],
providers: [DonutChartComponent]
}).compileComponents();
beforeEach(() => {
fixture = TestBed.createComponent(DonutChartComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
component = TestBed.inject(DonutChartComponent);
}));
it('should create', () => {
expect(component).toBeTruthy();