1.2.1 • Published 2 years ago

hicp-api-utils v1.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago