diff --git a/.travis.yml b/.travis.yml index fc0ae39..9c4c6d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_script: - chmod a+w tests.db script: - ./src/api/vendor/phpunit/phpunit/phpunit -c test/api/phpunit.xml - - ng test -cc + - ng test -cc -sr # - gulp test-app && gulp coverage after_success: - echo -e " version.php diff --git a/package-lock.json b/package-lock.json index 4045032..2287ac7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6122,9 +6122,9 @@ } }, "jasmine-core": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.1.0.tgz", - "integrity": "sha1-pHheE11d9lAk38kiSVPfWFvSdmw=", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", + "integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=", "dev": true }, "jasmine-spec-reporter": { diff --git a/package.json b/package.json index ce73819..4002f97 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "bourbon": "5.0.0", "bourbon-neat": "1.9.0", "codelyzer": "^4.2.1", - "jasmine-core": "~3.1.0", + "jasmine-core": "^2.8.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~2.0.0", "karma-chrome-launcher": "~2.2.0", diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index bcbdf36..fc13196 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,27 +1,35 @@ import { TestBed, async } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { HttpModule } from '@angular/http'; + import { AppComponent } from './app.component'; +import { + Notifications, + NotificationsService, + StringsService +} from './shared/index'; + describe('AppComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ - AppComponent + imports: [ + RouterTestingModule, + HttpModule ], + declarations: [ + AppComponent, + Notifications + ], + providers: [ + StringsService, + NotificationsService + ] }).compileComponents(); })); + it('should create the app', async(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); })); - it(`should have as title 'app'`, async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('app'); - })); - it('should render title in a h1 tag', async(() => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); - })); });