Reputation: 7
Looking at the provided screenshot:
In the response at Pretty section, I have 36 lines of data. I would like to write a test for this request, which would check if the response body lines were 36 each time the request is run. What would be your suggested test code for this test?
Upvotes: 0
Views: 835
Reputation: 1240
I had the same problem. Here's my solution:
let text = pm.response.text();
let lines = text.split("\n");
let length = lines.length;
pm.expect(length).to.eql(36);
Upvotes: 0