hicp-api-utils
v1.2.1
Published
hicp api tools for REST API I/O
Downloads
5
Readme
This is a simple package to parse hicp api responses
Add hicp-api-utils to your bruno collection
- create a package.json inside your collection folder
{
"name": "hicp-api-utils-collection",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"hicp-api-utils": "latest"
}
}
- run
npm install
Using hicp-api-utils inside your request
In the 'test' section, you can use it like this :
// importing hicp-api-utils
const hicpApiUtils = require('hicp-api-utils');
// calling check response function
hicpApiUtils.checkResponse(
// expected http status, hicp treatment, hicp error
expected = {
status: 200,
isTreatmentOk: true,
hicpErrorCode: null
},
// test function to call
testFunction = function(msg, bool) {
test(msg, function() {
expect(bool).to.equal(true);
});
},
// after function to call if all tests were successfull
afterFunction = function() {
console.log("all tests were successfull");
}
);