This file contains hidden or 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
| const BowlingGame = require('./bowling-game'); | |
| it('should return 0 for a game of all gutter balls', () => { | |
| const game = new BowlingGame(); | |
| for (let i = 0; i < 20; i++) { | |
| game.roll(0); | |
| } | |
| expect(game.score).toEqual(0); |
This file contains hidden or 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
| // Based on example from: https://angular.io/guide/component-interaction#parent-listens-for-child-event | |
| @Component({ | |
| selector: 'app-voter' | |
| }) | |
| export class VoterComponent { | |
| @Output() voted = new EventEmitter<boolean>(); | |
| didVote = false; | |
| constructor(private loggingService: LoggingService){} |
This file contains hidden or 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
| export function stub<T>(partial?: Partial<T>): T { | |
| return partial != null ? (partial as T) : ({} as T); | |
| } |
This file contains hidden or 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
| // Based on example from: https://angular.io/guide/component-interaction#parent-listens-for-child-event | |
| @Component({ | |
| selector: 'app-voter' | |
| }) | |
| export class VoterComponent { | |
| @Output() voted = new EventEmitter<boolean>(); | |
| didVote = false; | |
| constructor(private loggingService: LoggingService){} |
This file contains hidden or 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
| FROM node:5.5.0 | |
| EXPOSE 3000 | |
| RUN mkdir -p /usr/src/app | |
| WORKDIR /usr/src/app | |
| COPY package.json /usr/src/app/ | |
| RUN npm install |
This file contains hidden or 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
| docker run --name dockerized-container -d -p 3000:3000 dockerized node server.js |
This file contains hidden or 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
| docker build -t dockerized . |
This file contains hidden or 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
| FROM node:5.5.0 | |
| EXPOSE 3000 | |
| RUN mkdir -p /usr/src/app | |
| WORKDIR /usr/src/app | |
| COPY . /usr/src/app |
This file contains hidden or 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
| const http = require('http'); | |
| const port = 3000; | |
| http.createServer((req, res) => { | |
| res.writeHead(200, { 'Content-Type': 'text/plain' }); | |
| res.end('Dockerized!\n'); | |
| }).listen(port, () => { | |
| console.log(`Server running at http://0.0.0.0:${port}/`); | |
| }); |