I tried searching if someone else had this issue but no luck. Iām having an issue with completing an assignment as shown in this workspace. The tests I wrote definitely worked but when I check my solution I get this error in the test suite.
The assignment is to write a test that checks if the API returned status code 200. Hereās what it looks like.
I love the way that course is basically cribbed from the Postman Learning Centre courses, including the āIf you have any failures, review the failed test results or ask for support in the community forumā.
Anyways, if you look at the failing test. It does a few things.
pm.test("Get API status contains status 200 test", () => {
let request = folder.item.find(req => {return req.name === "Get API status"})
pm.expect(request.event[0].script.exec.toString(), 'check script').includes("pm.test");
pm.expect(request.event[0].script.exec.toString(), 'check script').includes("pm.response.to.have.status");
});
The error is showing 'expected " to include āpm.testā".
This part is basically the tests tab for the request.
request.event[0].script.exec.toString()
I suspect the issue is that its canāt find the request name.
Do you have a request called āGet API statusā. (Which will be case sensitive).