项目作者: Stayfi

项目描述 :
Rock, Paper, Scissors & Lizard, Spock (Node.js)
高级语言: JavaScript
项目地址: git://github.com/Stayfi/rock-paper-scissors-nodejs.git
创建时间: 2019-11-21T14:20:41Z
项目社区:https://github.com/Stayfi/rock-paper-scissors-nodejs

开源协议:MIT License

下载


Rock, Paper, Scissors & Lizard, Spock (Node.js)

version: ‘v1.0.6’

Build Status
Coverage Status

Description

For an interview, i was asked to dev this game with thoses users story:

  • Front

    As a frequent games player,

    I’d like to play rock, paper, scissors

    So that I can spend an hour of my day havind fun

    Acceptance Criteria:

    • Can I play Player vs Computer?
    • Can I play Computer vs Computer?
    • Can I play a different game each time?
  • Back

    Technical Constraints:

    • Doesn’t necessarly need a flashy GUI (can be simple)
    • Use PHP (Scala or Javascript)
    • Libs / external modules should only be used for tests
    • Using best in industry agile engineering practices

Best if we use TDD, code coverage, copy and paste detection, designs (DDD, or design patterns).

So, i tried to use my “code-sens” to doing my best in less than one day, starting from scratch.

You will find here, an example of TDD, with a lot of tests.

Prepare your envionement

Clone the project in your workspace

  1. $ git clone https://github.com/Stayfi/rock-paper-scissors-nodejs.git

install dependencies

Go to the project directory and do

  1. $ npm install

Start the project

  1. $ npm run start

Open your browser to : http://localhost:3000

Running tests

  1. $ npm run test

Test results

Running coverage

  1. $ npm run coverage

Coverage results

Running copy/paste detection

  1. $ npm run jscpd

Jscpd results