hicp-api-utils

1.2.1 • Public • Published

This is a simple package to parse hicp api responses

Add hicp-api-utils to your bruno collection

  1. 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"
  }
}
  1. 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");
  }
);

Readme

Keywords

none

Package Sidebar

Install

npm i hicp-api-utils

Weekly Downloads

2

Version

1.2.1

License

MIT

Unpacked Size

2.54 kB

Total Files

3

Last publish

Collaborators

  • antoine-buisson
  • marwannriou