Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #4 from cloudliner/step/3
Step 3 CI: 継続的インテグレーション編
- Loading branch information
Showing
8 changed files
with
107 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
dist: trusty | ||
sudo: required | ||
language: node_js | ||
node_js: | ||
- 8.9.4 | ||
addons: | ||
chrome: stable | ||
cache: | ||
apt: true | ||
bundler: true | ||
directories: | ||
- node_modules | ||
before_install: | ||
- export CHROME_BIN=chromium-browser | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
before_script: | ||
- ng lint | ||
- ng test --single-run --code-coverage | ||
- ng e2e | ||
script: | ||
- ng build --prod | ||
after_success: | ||
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js | ||
deploy: | ||
provider: firebase | ||
token: | ||
secure: adXjXAiklHyh0IZkpyxi7SJdSGDaE63RdeyWjq0mWjy44gwRSYVkloOBBa2/RSdKIaamzlh0D7CAtZVgLWUjoPRPVDjdPnTXvDMNKjSR0XnMOcPx4PSFulVUWymYixtc1GaSeck/DH6kH5KNFdy3vITJAnyH4Bm05+DgS4/KGvQjwDnXWQ2U3gU4fJ2B44Lu+/pk1WWTlnL6JwXfKrPVp+IvHRfhYYKBvMCPwxhC65Ut4I5i7GKccqS95oalu9ws5H9YSRUR/PDrm1hdU3VxcK22NnHhd9qSZl/wVt3xfdcqnBxN8y2w5g5xBcEcMeJ1f4E19xZUt7Y2VdmTlpEDgmlEUljetxgVXDTe3poHPNJVKjQVM8w0uGmsB8yfoQcL5YsdH3eBTe9OuubprMhE+pJUlmI5mnFMc+3Qtz3mRUIrlUGGJXVcYQxKOGtm49fEhjUX+axzcUETIJt0jN17DKDmBdDigKVty5DSQSA+dKRKq+uy2aYKpITRebJ/gOUjyGDcJQinA0Lf8qjhVdTs/xxQMWOI06PNg1T6QUOcxBeC+8U25UQzIdpTzuSL8IFPUayQp23Wwm6oPw6g9V7+TEo3Cb2DiASAbXmO2ABmlFcKNdYsFA4vRZ8yGQS4te/h8Xpqkqx0lyqTn7xaWFP0OZIqYOxuD/SPlolFYR68+IY= | ||
skip_cleanup: true | ||
on: | ||
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "chrome", | ||
"request": "launch", | ||
"name": "Launch Chrome against localhost", | ||
"url": "http://localhost:4200", | ||
"webRoot": "${workspaceFolder}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,46 @@ | ||
import { TestBed, async } from '@angular/core/testing'; | ||
import { AngularFirestore } from 'angularfire2/firestore'; | ||
import { environment } from '../environments/environment'; | ||
import { AppComponent } from './app.component'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import 'rxjs/add/observable/from'; | ||
|
||
const timeline = [[ | ||
{ message: 'Hello, Test!' } | ||
]]; | ||
const data = Observable.from(timeline); | ||
const collectionStub = { | ||
valueChanges: jasmine.createSpy('valueChanges').and.returnValue(data) | ||
}; | ||
const angularFiresotreStub = { | ||
collection: jasmine.createSpy('collection').and.returnValue(collectionStub) | ||
}; | ||
|
||
describe('AppComponent', () => { | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
AppComponent | ||
], | ||
providers: [ | ||
{ provide: AngularFirestore, useValue: angularFiresotreStub } | ||
] | ||
}).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(() => { | ||
it('should have timeline', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app.title).toEqual('app'); | ||
expect(app.timeline).toBeDefined(); | ||
})); | ||
it('should render title in a h1 tag', async(() => { | ||
it('should render message in a li tag', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
fixture.detectChanges(); | ||
const compiled = fixture.debugElement.nativeElement; | ||
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); | ||
expect(compiled.querySelector('ul>li').textContent).toContain('Hello, Test!'); | ||
})); | ||
}); |