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
| You are an experienced, pragmatic software engineer. You don't over-engineer a solution when a simple one is possible. | |
| Rule #1: If you want exception to ANY rule, YOU MUST STOP and get explicit permission from Ihor first. BREAKING THE LETTER OR SPIRIT OF THE RULES IS FAILURE. | |
| ## Foundational rules | |
| - Doing it right is better than doing it fast. You are not in a rush. NEVER skip steps or take shortcuts. | |
| - Tedious, systematic work is often the correct solution. Don't abandon an approach because it's repetitive - abandon it only if it's technically wrong. | |
| - Honesty is a core value. If you lie, you'll be replaced. | |
| - You MUST think of and address your human partner as "Ihor" at all times |
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 class CreatePostCommand extends Command { | |
| /** | |
| * Creates a command for adding new post to the system, | |
| * @param {Posts} posts - posts in system | |
| */ | |
| constructor(posts) { | |
| super(); | |
| this.posts = posts; |
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
| import { NotYetImplementedError } from './NotYetImplementedError'; | |
| /** | |
| * Interface for classes that implement Command Pattern | |
| * | |
| * @interface | |
| */ | |
| export class Command { | |
| /** |
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 class NotYetImplementedError extends Error { | |
| get name () { | |
| return this.constructor.name; | |
| } | |
| } |
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
| describe('NumberSumCalculatoin', () => { | |
| it('passed sum calculaton', () => { | |
| expect(new NumberSumCalculation(2, 2).calculate()).toEqual(4); | |
| }) | |
| }) |
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
| /* @todo: #1132:15m/DEV Implement Number Sum Calculation | |
| * | |
| */ | |
| export class NumberSumCalculation implements Calucation<number> { | |
| /** | |
| * Create a number sum calculation. | |
| * @param {number} left - The left value. | |
| * @param {number} right - The right value. |
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
| /** | |
| * Represents a generic calculation. | |
| * Allow to go beyound standard language types and operators | |
| */ | |
| export interface Calculation<R> { | |
| /** | |
| * Execute calculation within entities usually provided in constructor | |
| * @return {R} result - calculation result | |
| */ | |
| calculate(): R; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>My first Vue app</title> | |
| <script src="https://unpkg.com/vue"></script> | |
| </head> | |
| <body> | |
| <div id="app"> | |
| {{ message }} | |
| </div> |
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
| license: mit |
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
| import fs from 'fs'; | |
| import path, { resolve } from 'path'; | |
| import assert from 'assert'; | |
| import Module from 'module'; | |
| import jsdom from 'jsdom'; | |
| import Mocha from 'mocha'; | |
| import chokidar from 'chokidar'; | |
| // Let's import and globalize testing tools so | |
| // there's no need to require them in each test |
NewerOlder