[GH-ISSUE #1353] Add more test methods #444

Closed
opened 2026-03-16 15:20:28 +03:00 by kerem · 4 comments
Owner

Originally created by @carlos-ds on GitHub (Nov 30, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1353

I'd like to add some more built-in assertion methods to the tests section because that is currently limited to:

  • toHaveProperty
  • toBe
  • toBeLevel2xx
  • toBeLevel3xx
  • toBeLevel4xx
  • toBeLevel5xx

I'm thinking about adding at least:

  • toHaveLengthOf
  • toBeOfType

I'd also write some tests for both these methods and the currently existing methods.

Let me know if you have more ideas or remarks about this topic.

Originally created by @carlos-ds on GitHub (Nov 30, 2020). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1353 I'd like to add some more built-in assertion methods to the tests section because that is currently limited to: - toHaveProperty - toBe - toBeLevel2xx - toBeLevel3xx - toBeLevel4xx - toBeLevel5xx I'm thinking about adding at least: - toHaveLengthOf - toBeOfType I'd also write some tests for both these methods and the currently existing methods. Let me know if you have more ideas or remarks about this topic.
kerem 2026-03-16 15:20:28 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@liyasthomas commented on GitHub (Nov 30, 2020):

Thanks for bringing this up. These are some essential additions. The testing part of Hoppscotch can be increased a lot more and have unmet potentials.

<!-- gh-comment-id:736095389 --> @liyasthomas commented on GitHub (Nov 30, 2020): Thanks for bringing this up. These are some essential additions. The testing part of Hoppscotch can be increased a lot more and have unmet potentials.
Author
Owner

@carlos-ds commented on GitHub (Dec 1, 2020):

PR: #1357

<!-- gh-comment-id:736824684 --> @carlos-ds commented on GitHub (Dec 1, 2020): PR: #1357
Author
Owner

@liyasthomas commented on GitHub (Dec 2, 2020):

Resolved in #1357.

<!-- gh-comment-id:736927017 --> @liyasthomas commented on GitHub (Dec 2, 2020): Resolved in #1357.
Author
Owner

@humbertoarizah commented on GitHub (Mar 29, 2022):

Hi, I have been having problems with the method "toHaveProperty", for any reason I'm getting an error ('unknown property 'toHaveProperty'). Even when I try to replicate the following example, I get the error:

// This test will pass
pw.test("Response is ok", () => {
pw.expect(pw.response.status).toBe(200);
pw.expect(pw.response.body).not.toHaveProperty("errors");
});

So, I'm not sure what is happening?
I would appreciated any help.

<!-- gh-comment-id:1081451723 --> @humbertoarizah commented on GitHub (Mar 29, 2022): Hi, I have been having problems with the method "toHaveProperty", for any reason I'm getting an error ('unknown property 'toHaveProperty'). Even when I try to replicate the following example, I get the error: // This test will pass pw.test("Response is ok", () => { pw.expect(pw.response.status).toBe(200); pw.expect(pw.response.body).not.toHaveProperty("errors"); }); So, I'm not sure what is happening? I would appreciated any help.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#444
No description provided.