This is my version of the C.A.G geometry calculator task.
You can install the module by simply running:
npm install gcn
I have used mocha for all testing. I had planed to use property based testing with jsverify but I couldn't figure out how to make it work for tests I wanted to do in a nice way so I decided to leave it out.
To test the API just run:
npm test
I have used eslint as the linter for the project.
I used a modified version of the .eslintrc.json
from ramda.
To run eslint just run:
npm run lint
The linter generates only generates output if there are any errors or warnings.
I have used istanbul for the code coverage.
To generate a test coverage report just run:
npm run cover
The report will be placed in coverage/
.
You can generate the API documentation by running:
npm run doc
The generated documentation will be placed in doc/
.
In doing this small task I have realized the full extent of how little I know about either JavaScript or Node. I have absolutely no idea what are actually are the best practices for writing JavaScript code is so I have pretty much just winged it.
I have also not been that heavy on the KISS aspect. Even though this task was very minimal and there are much simpler ways of fulfilling the requirements I have gone for some imaginary reusability and extensibility.