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
import { browser, by, element } from 'protractor'; | |
export class LetslearnPage { | |
navigateTo() { | |
return browser.get('/'); | |
} | |
getTitle() { | |
return element(by.css('lsl-root h1')).getText(); |
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
<h1>{{title}}</h1> | |
<div> | |
Points: <span>{{points}}</span> | |
</div> | |
<button (click)="plus1()">Plus 1</button> | |
<button (click)="reset()">Reset</button> |
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
// Karma configuration file, see link for more information | |
// https://karma-runner.github.io/0.13/config/configuration-file.html | |
module.exports = function (config) { | |
config.set({ | |
basePath: '', | |
frameworks: ['jasmine', '@angular/cli'], | |
plugins: [ | |
require('karma-jasmine'), | |
require('karma-chrome-launcher'), |
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
image: node:latest | |
cache: | |
paths: | |
- node_modules/ | |
test_letslearn: | |
script: | |
- npm install | |
- ./node_modules/@angular/cli/bin/ng test --single-run=true --browsers PhantomJS --watch=false |
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
git remote add origin git@gitlab.com:XXyour_userXX/XXyour_projectXX.git | |
git add -A | |
git commit -m 'TDD from letsboot rocks!' | |
git push -u origin 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
/* ... */ | |
/* enable these */ | |
import 'core-js/es6/symbol'; | |
import 'core-js/es6/object'; | |
import 'core-js/es6/function'; | |
import 'core-js/es6/parse-int'; | |
import 'core-js/es6/parse-float'; | |
import 'core-js/es6/number'; |
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
<h1>{{title}}</h1> | |
{{points}} | |
<button (click)="plus1()">plus1</button> |
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
import { async, TestBed } from '@angular/core/testing'; | |
import { By } from '@angular/platform-browser'; /* add this to use By.css('button') */ | |
import { AppComponent } from './app.component'; | |
describe('AppComponent', () => { | |
/* ... */ | |
it(`should have as title 'lsl'`, async(() => { | |
/* ... */ |
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
npm install -g @angular/cli | |
ng --version # tutorial tested with: @angular/cli: 1.2.0, node: 8.1.2 | |
ng new letslearn --prefix lsl | |
cd letslearn | |
ng serve -o |
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
#!/bin/bash | |
export SWARM_KV="kv" | |
export SWARM_NODES="node1 node2 node3" | |
for node in $SWARM_KV ; do docker-machine create -d virtualbox $node; done | |
eval $(docker-machine env kv) ; | |
docker run -d -p 8500:8500 gliderlabs/consul-server -data-dir=/tmp -bind=0.0.0.0 -bootstrap |