Skip to content

Commit

Permalink
test: make tests pass by importing the app module
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepinho committed Apr 23, 2017
1 parent ade4b27 commit 12611b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
19 changes: 2 additions & 17 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
import { FormsModule } from '@angular/forms';
import { TestBed, async } from '@angular/core/testing';

import { AppComponent } from './app.component';
import { FaceComponent } from './face/face.component';
import { SvgComponent } from './svg/svg.component';
import { TimelineComponent } from './timeline/timeline.component';
import { TweetComponent } from './tweet/tweet.component';
import { TwitterService } from './twitter.service';
import { AppModule } from './app.module';

describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent,
FaceComponent,
SvgComponent,
TimelineComponent,
TweetComponent,
],
imports: [
FormsModule,
],
providers: [
TwitterService,
AppModule,
],
}).compileComponents();
}));
Expand Down
17 changes: 2 additions & 15 deletions src/app/timeline/timeline.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';

import { FaceComponent } from '../face/face.component';
import { SvgComponent } from '../svg/svg.component';
import { AppModule } from '../app.module';
import { TimelineComponent } from './timeline.component';
import { TweetComponent } from '../tweet/tweet.component';
import { TwitterService } from '../twitter.service';

describe('TimelineComponent', () => {
let component: TimelineComponent;
let fixture: ComponentFixture<TimelineComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
FaceComponent,
SvgComponent,
TimelineComponent,
TweetComponent,
],
imports: [
FormsModule,
],
providers: [
TwitterService,
AppModule,
],
})
.compileComponents();
Expand Down
3 changes: 2 additions & 1 deletion src/app/twitter.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { TestBed, inject } from '@angular/core/testing';

import { AppModule } from './app.module';
import { TwitterService } from './twitter.service';

describe('TwitterService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [TwitterService]
imports: [AppModule],
});
});

Expand Down

0 comments on commit 12611b0

Please sign in to comment.