Skip to content

Commit

Permalink
chapter 04: creating the real webService connector
Browse files Browse the repository at this point in the history
  • Loading branch information
devcorpio committed Jan 12, 2019
1 parent 8b1bdd8 commit c51ced2
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const axios = require('axios').default;

function webService() {
/**
* @param {string} message
*/
async function logError(message) {
return axios({
method: 'POST',
url: 'http://localhost:3000',
data: message,
});
}

return {
logError,
};
}

module.exports = webService;
30 changes: 30 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"homepage": "https://github.com/devcorpio/the-art-of-unit-testing#readme",
"devDependencies": {
"@types/node": "^10.12.18",
"axios": "^0.18.0",
"husky": "^1.3.1",
"jest": "^23.6.0",
"prettier": "1.15.3",
Expand Down

0 comments on commit c51ced2

Please sign in to comment.