Postman - validate your api response array data use chai js

Chai is a BDD / TDD assertion library ,
that let you can write readable js test,
like this :

1
2
3
4
expect(2).to.equal(2); 
expect('foo').to.have.lengthOf(3); /
expect(resJson.total_count).to.be.an('number');
expect(resJson.data.length).to.be.above(0);

and postman support this library,
so here is a sample test script,
that will validate :

  1. important column not null
  2. iterator array check have data

Read More