Skip to content

Commit

Permalink
feat(CI): add travis conf (#21)
Browse files Browse the repository at this point in the history
* feat(CI): add travis conf

* feat(CI): fix build

* fix(CI): fix build about e2e
  • Loading branch information
Helias authored Feb 22, 2020
1 parent 5d7d90e commit 43d0352
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: node_js
node_js:
- '10'
dist: xenial
sudo: required
services:
- xvfb
addons:
chrome: stable
before_script:
- export DISPLAY=:99.0
install:
- npm set progress=false
- npm install
script:
- ng lint
- npm run test-ci
- npm run e2e
- npm run build
1 change: 0 additions & 1 deletion e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe('workspace-project App', () => {

it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('git-catalogue app is running!');
});

afterEach(async () => {
Expand Down
4 changes: 0 additions & 4 deletions e2e/src/app.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ export class AppPage {
navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl) as Promise<unknown>;
}

getTitleText(): Promise<string> {
return element(by.css('app-root .content span')).getText() as Promise<string>;
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"test-ci": "ng test --watch=false --code-coverage",
"lint": "ng lint",
"e2e": "ng e2e"
},
Expand Down
12 changes: 0 additions & 12 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,4 @@ describe('AppComponent', () => {
expect(app).toBeTruthy();
});

it(`should have as title 'git-catalogue'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('git-catalogue');
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;
expect(compiled.querySelector('.content span').textContent).toContain('git-catalogue app is running!');
});
});
8 changes: 7 additions & 1 deletion src/app/repo/repo.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { RepoComponent } from './repo.component';
import { MomentModule } from 'angular2-moment';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

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

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RepoComponent ]
declarations: [ RepoComponent ],
imports: [
MomentModule,
FontAwesomeModule,
],
})
.compileComponents();
}));
Expand Down

0 comments on commit 43d0352

Please sign in to comment.