mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 08:45:58 +03:00
[GH-ISSUE #2242] [bug]: test code can't use the "toHaveProperty" function - it does not exist #770
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#770
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pantchox on GitHub (Apr 7, 2022).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2242
Originally assigned to: @aitchnyu on GitHub.
Is there an existing issue for this?
Current behavior
When I write
the error indicator shows and hovering says 'Unknown Property' (which is ironic..)
The docs show usage of this method/function and I need to validate in the test that specific property exists or not.
What am i missing?
Using PWA installed from "cloud"
Steps to reproduce
write this code in the test:
Environment
Production
Version
Cloud
@pantchox commented on GitHub (Apr 7, 2022):
https://docs.hoppscotch.io/quickstart/tests#response - link for the example using it
@pantchox commented on GitHub (Apr 7, 2022):
@aitchnyu commented on GitHub (Oct 12, 2022):
@liyasthomas Seems
.toHavePropertyis not implemented in codebase and confirmed by @AndrewBastin . There are defunct tests inpostwomanTesting.sampleand there is a section about this in docs. Seems we should delete that section from docs to reflect existing scripting api and plan imlementing.toHavePropertyins the sandbox revamp.@AndrewBastin commented on GitHub (Oct 22, 2022):
@liyasthomas reminder to update the docs.
@BirnadinErick commented on GitHub (Nov 11, 2022):
is toHaveProperty still not implemented?
@anthonyaxenov commented on GitHub (Dec 12, 2022):
This is not a bug in fact. I met same problem and quickly found this simple workaround:
I think the current test API is simple and good enough so far as you can still use basic js as usual and you are not limited by this API only. Maybe I'm wrong just because today is the first day I try to migrate from Postman but I already have good experience here.
At least it is necessary to replace the last screenshot here - https://docs.hoppscotch.io/quickstart/tests#assert-response-payload. Or implement
.toHaveProperty()which I bet was and/or will be just a kinda wrapper of my example above.@AndrewBastin commented on GitHub (Dec 12, 2022):
@anthonyaxenov I know it is a bit difficult but we are keeping the current APIs frozen as we are revamping the current scripting section to be a lot more capable. We have an RFC open for the Scripting revamp which we would love everyone's feedback on (see #2292). This will take a bit of time to get implemented but we think it is well worth the effort to push scripting features a lot more.
@ChindrisSebilix commented on GitHub (Aug 6, 2024):
@AndrewBastin not sure if you need the reminder, but
.toHavePropertyis still not implemented/removed from docs