TDD Exercise

We have created an empty project for you all, use this starting point

git clone https://livingwater@bitbucket.org/living-water-js/find-highest-number.git

  1. Create a new repo on your github account. A possible name might be “find-highest-number-tests”

  2. Using git bash navigate to the /c/work folder

  3. Clone this project down using this command git clone https://livingwater@bitbucket.org/living-water-js/find-highest-number.git

  4. Change the remote location to your repo using the command git remote set-url origin <remote_url> (where <remote_url> is the url of your new repo)

  5. In Visual Studio Code open the folder find-highest-number

  6. Under the test folder open the file below find-highest-number-test.js

Specification

  • If the input were {4, 5, -8, 3, 11, -21, 6} the result should be 11

  • A single item array should return the single item

  • If several numbers are equal and highest, only one should be returned

  • If the input were {7, 13}  then the result should be 13

  • If the input were {13, 4}  then the result should be 13