mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #2221] [feature]: Add expect().toInclude([string]) method #765
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#765
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 @ace-n on GitHub (Apr 1, 2022).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2221
Originally assigned to: @ace-n on GitHub.
Is there an existing issue for this?
Summary
Add a
toInclude()method topw.expect()(
toContain()could work too, but JS itself usesincludes(), notcontains().)Why should this be worked on?
I want to assert that an unstructured page contains a certain string of text.
(For example, I want to assert that
/attractions?q=egyptshould containPyramids of Giza)Current workaround
Currently, you can do the following:
This is suboptimal for two reasons:
Contribution notes
I'm happy to take a first-pass at an implementation myself, if a maintainer is OK with it! 😄
@liyasthomas commented on GitHub (Apr 1, 2022):
Hi @ace-n, feel free to pick up this feature request. Do let us know if you've any trouble understanding the source code. Assigning this to you.