A solution for the HackerRank challenge, "The Time in Words", which also includes tests written using Mocha and Chai.
These instructions will get you a copy of the solution up and running on your local machine for testing.
There are a few things you will need in order to install and run this solution.
- A text editor e.g. VS Code
- npm package manager (comes with node.js) Installation instructions
- Node.js v8.1.0 Installation Instructions
- Mocha v5.0.5 Installation Instructions
- Chai v4.1.2 library Installation Instructions
A step by step series of examples that tell you how to get running
-
Fork this repository and clone it so you have your own local copy
-
cd into the folder you want to save the copy to e.g.
cd Documents/myprojects
and run the git clone command in your terminal
$ git clone https://github.com/HorrorOfPartyBeach/hackerrank
- Run
cd hackerrank
and thennpm install
- Open the folder in VS Code (or another editor) and install dependencies by running the following command:
$ npm install
To run the tests, ensure you have Mocha and Chai installed and add a test script to the package.json
"scripts": {
"test": "mocha ./spec/*.spec.js"
}
The tests use Mocha and the Chai library to test that the function correctly converts a numerical time into a string of words.
To run the tests, run npm test
Emma Gilmour - HorrorOfPartyBeach
This project is licensed under the MIT License - see the LICENSE.md file for details