Read this document carefully and follow ALL instructions.
The coding challenge requires the following to be installed on your development machine;
- Fork the
javascript-developer-testrepository to your personal github account. - Clone the
javascript-developer-testrepository from your personal github account onto your development machine. - Open a terminal and
cdinto the root directory of thejavascript-developer-testrepository. - Execute
npm installin the terminal.
Your challenge is to implement the getArnieQuotes() function, which is exported from ./src/get-arnie-quotes.js.
The unit tests in ./src/get-arnie-quotes.test.js will provide pre-defined URLs to the function and test your function's implementation. To run the unit tests, execute npm test in the terminal.
The goal is to write an implementation of getArnieQuotes() that meets all requirements and passes all unit tests.
- Use the provided
httpGetfunction to get the quote for the URL - For a successful request
- return an object with a single key
"Arnie Quote"and the HTTP response body'smessageproperty as the key's associated value.
- return an object with a single key
- For an unsuccessful request
- return an object with a single key
"FAILURE"and the HTTP response body'smessageproperty as the key's associated value.
- return an object with a single key
- Success is denoted by the HTTP response status code 200.
- Input validation for
get-arnie-quotes()is not required.
- Only push changes to the
get-arnie-quotes.jsfile. - Do not create a pull request against our source repository.
- Other solutions to this puzzle are available on github and can be used to give you ideas, however, not all forked solutions are correct.
- Direct plagiarism results in an immediate failure.
An example results array:
[
{ 'Arnie Quote': 'Some cool quote' },
{ 'FAILURE': 'Your request has been terminated' },
]
An example HTTP response:
{
status: 200,
body: "{ 'message': 'Some cool arnie quote' }" // JSON string
}
Once all unit tests pass, push your code upstream then send us the link to your github repo with your solution.