Skip to content

Latest commit

 

History

History
80 lines (51 loc) · 1.51 KB

File metadata and controls

80 lines (51 loc) · 1.51 KB

Setup

Prerequisites

Before starting to test this API locally you need to assure you have the following prerequisites:

Installation and usage

  1. Clone the repo and install all the required packages:
 git clone http://github.com/CodeRoyale/codeRoyale-Question-api
 cd codeRoyale-Question-api
 npm install

  1. Run development server command npm run dev

  2. Test by sending requests at localhost:3000

Testing

  1. To run all the tests with mocha:
 npm run test

Development

Before starting to make changes

  1. Create a new branch
git checkout -b branch_name

  1. Make your relevant changes

  2. Make appropriate changes in test if have changed the API or created new API

  3. Make sure to document the changes in code by commenting it. Make relevant changes in swagger documentation if required.

  4. To run all the tests with mocha before commiting it:

 npm run test

Before Commiting / Pushing to repo

  • 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