Before starting to test this API locally you need to assure you have the following prerequisites:
Node.JS see: Installing Node.js
npm see: Installing npm
MongoDB see: Installing MongoDB
- Clone the repo and install all the required packages:
git clone https://github.com/CodeRoyale/codeRoyale-Question-api
cd codeRoyale-Question-api
npm install
Run development server command
npm run devTest by sending requests at
localhost:3000
- To run all the tests with mocha:
npm run test
- Create a new branch
git checkout -b branch_name
Make your relevant changes
Make appropriate changes in test if have changed the API or created new API
Make sure to document the changes in code by commenting it. Make relevant changes in swagger documentation if required.
To run all the tests with mocha before commiting it:
npm run test
- Format all files supported by Prettier in the current directory and its subdirectories
npm run prettier:write
- Check that all files match prettier code style
npm run prettier:check - Run eslint to check whether all files follow the lint rules
npm run lint
- Run eslint to handle the simple fixes automatically
npm run lint:fix