From 4fbf806fe2318d98257b4cefd9e8011540c10052 Mon Sep 17 00:00:00 2001 From: alibw <69758323+alibw@users.noreply.github.com> Date: Sun, 3 Sep 2023 16:36:26 +0330 Subject: [PATCH] Update Count.http Added : without prefer header test --- Count.http | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Count.http b/Count.http index a036edd..06c7a48 100644 --- a/Count.http +++ b/Count.http @@ -1,7 +1,3 @@ -{{ - const { equal } = require('assert'); -}} - GET {{baseUrl}}/products Prefer: count=exact ?? status == 200 @@ -12,4 +8,15 @@ Prefer: count=exact test('OK content-range', () => { equal(response.headers['content-range'], `0-${itemsCount - 1}/${itemsCount}`); }); +}} + +GET {{baseUrl}}/products +?? status == 200 +{{ + const { equal } = require('assert'); + let responseItems = JSON. parse(response.body); + let itemsCount = responseItems.length; + test('OK content-range', () => { + equal(response.headers['content-range'], `0-${itemsCount - 1}/*`); + }); }} \ No newline at end of file