Removed old rules from eslint
Tried hand at testing by fixing the spec files with import. However, still many errors and given up now.
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
|
||||
import { ProductDetailComponent } from './product-detail.component';
|
||||
|
||||
@ -8,6 +11,7 @@ describe('ProductDetailComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [MatDialogModule, ReactiveFormsModule, RouterTestingModule],
|
||||
declarations: [ProductDetailComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
@ -1,18 +1,17 @@
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
|
||||
import { ProductListResolverService } from './product-list-resolver.service';
|
||||
import { ProductListResolver } from './product-list-resolver.service';
|
||||
|
||||
describe('ProductListResolverService', () => {
|
||||
describe('ProductListResolver', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [ProductListResolverService],
|
||||
imports: [HttpClientModule],
|
||||
providers: [ProductListResolver],
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject(
|
||||
[ProductListResolverService],
|
||||
(service: ProductListResolverService) => {
|
||||
expect(service).toBeTruthy();
|
||||
},
|
||||
));
|
||||
it('should be created', inject([ProductListResolver], (service: ProductListResolver) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
|
||||
import { ProductListComponent } from './product-list.component';
|
||||
|
||||
@ -8,6 +10,7 @@ describe('ProductListComponent', () => {
|
||||
|
||||
beforeEach(fakeAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ReactiveFormsModule, RouterTestingModule],
|
||||
declarations: [ProductListComponent],
|
||||
}).compileComponents();
|
||||
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
|
||||
import { ProductResolverService } from './product-resolver.service';
|
||||
import { ProductResolver } from './product-resolver.service';
|
||||
|
||||
describe('ProductResolverService', () => {
|
||||
describe('ProductResolver', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [ProductDetailResolverService],
|
||||
imports: [HttpClientModule, RouterTestingModule],
|
||||
providers: [ProductResolver],
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject(
|
||||
[ProductDetailResolverService],
|
||||
(service: ProductDetailResolverService) => {
|
||||
expect(service).toBeTruthy();
|
||||
},
|
||||
));
|
||||
it('should be created', inject([ProductResolver], (service: ProductResolver) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
|
||||
import { ProductService } from './product.service';
|
||||
|
||||
describe('ProductService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientModule],
|
||||
providers: [ProductService],
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user