This is a sample code to consume a json hosted at http://agl-developer-test.azurewebsites.net/people.json and output a list of all the cats in alphabetical order under a heading of the gender of their owner.
Example:
Male
- Angel
- Molly
- Tigger
Female
- Gizmo
- Jasper
# to install node modules (to be done once)
npm install
# to run the project
npm start
# to run test suites
npm test
# to create build
npm run build
# to run test cases in watch mode
npm run tdd
This project is written using the following tools:
- JavaScript
ES2015
version Webpack 2.x
as module bundlerBabel JS
as the compiler.Mocha JS
testing framework.Chai JS
as the assertion libraryIstanbul JS
as the code coverage library
To get coverage report
npm test
HTML Report can be accessed from here
The server does not support Cross Origin Resource Sharing (CORS), therefore the below error may be shown:
FAILED: Failed to fetch
To fix this, start Google Chrome with disabled web-security using the following command:
open -a "Google Chrome" --args --user-data-dir --disable-web-security
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\chrome"