Skip to content

Commit

Permalink
GET Store Inventory - Add Test Case and Assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatimazza committed Mar 15, 2023
1 parent d929174 commit 54b6afd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/api/getStoreInventory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const assert = require("chai").assert;
const expect = require("chai").expect;
const request = require("supertest");
const baseUrl = 'https://petstore.swagger.io/v2'

describe("PetStore Get Inventory - GET", () => {

// test case
it("1A Status Code should be 200", async () => {
// request to URL
const response = request(baseUrl)
.get('/store/inventory');
console.log((await response).status);
console.log((await response).body);
// assertion
// sometimes failed
assert.equal((await response).status, 200);
expect((await response).statusCode).equal(200);
})
})

0 comments on commit 54b6afd

Please sign in to comment.