1.2.1 • Published 3 years ago
dikkenek-quotes v1.2.1
Dikkenek Quotes
A simple NodeJS based application to get random quotes from the film "Dikkenek".
Tech stack
This application runs on NodeJS. You can get the latest build from the official website https://nodejs.org/en/.
Installation
Follwing are the steps to install this application
- Clone this repository from https://github.com/Popovkov57/Dikkenek-quotes. In the terminal/command prompt,
cdto the desired directory and type
git clone git@github.com:Popovkov57/Dikkenek-quotes.gitcdinto theDikkenek-quoteswhich was cloned.
cd Dikkenek-quotes- Install necessary dependencies
npm installFile Structure
The Dikkenek-quotes has an src directory which consists of three files
dikkenek-quotes.json: It containsJSONdata of a list of quotes.index.js: It defines methods to pick a random quote fromdikkenek-quotes.json.index.test.js: It contains unit tests for methods defined inindex.js.
Running the application
- To run all the unit tests, we use
mocha, a JS testing library. Type
./node_modules/mocha/bin/mocha src/index.test.jsto run all tests. The output should be
dikkenek-quotes
all
✓ it should be an array of string
✓ it should contain `C’est excessivement énervant !`
random
✓ should return a random item from dikkenk.all
✓ should return an array of random items if passed a number
4 passing (8ms)- To use this library in your own app, you simply include the
index.jsanddikkenek-quotes.jsonfile in working directory andrequireit in your file. Then you can use the methods defined inindex.js.