[PR #2234] [MERGED] feat: add toInclude() function #3681

Closed
opened 2026-03-17 01:16:34 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/2234
Author: @ace-n
Created: 4/5/2022
Status: Merged
Merged: 4/5/2022
Merged by: @AndrewBastin

Base: mainHead: to-contains


📝 Commits (5)

  • 7aaf421 feat: add toInclude() function
  • 0b2c0d5 Merge branch 'main' into to-contains
  • b2a74da Fix typo in pw-test.json
  • d259381 Merge branch 'main' into to-contains
  • b7dfe41 chore: bump sandbox version and cli version

📊 Changes

5 files changed (+244 additions, -3 deletions)

View changed files

📝 packages/hoppscotch-app/helpers/terndoc/pw-test.json (+2 -1)
📝 packages/hoppscotch-cli/package.json (+1 -1)
📝 packages/hoppscotch-js-sandbox/package.json (+1 -1)
packages/hoppscotch-js-sandbox/src/__tests__/testing/expect/toInclude.spec.ts (+183 -0)
📝 packages/hoppscotch-js-sandbox/src/test-runner.ts (+57 -0)

📄 Description

Closes #2221

Description

Adds toInclude operator to testing suite

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation (N/A)
  • I have updated the documentation as required (N/A)
  • All the tests have passed

Additional Information

"123".toInclude(123) will return true even though their types are different (string vs. int).

I included a comment about this, with a link to the relevant JS spec.

If this is an issue, we should switch to indexOf instead of includes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/2234 **Author:** [@ace-n](https://github.com/ace-n) **Created:** 4/5/2022 **Status:** ✅ Merged **Merged:** 4/5/2022 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `main` ← **Head:** `to-contains` --- ### 📝 Commits (5) - [`7aaf421`](https://github.com/hoppscotch/hoppscotch/commit/7aaf421d85c003fbd6470099cf2dbb9081928bc9) feat: add toInclude() function - [`0b2c0d5`](https://github.com/hoppscotch/hoppscotch/commit/0b2c0d507cb990873a6116f7c543037fbf0bce5e) Merge branch 'main' into to-contains - [`b2a74da`](https://github.com/hoppscotch/hoppscotch/commit/b2a74da6a5b2b1d26a02bd2b430bca2deaf5e4f2) Fix typo in pw-test.json - [`d259381`](https://github.com/hoppscotch/hoppscotch/commit/d259381a34d7e8167880be00f82aaba91dd2ffb1) Merge branch 'main' into to-contains - [`b7dfe41`](https://github.com/hoppscotch/hoppscotch/commit/b7dfe41b3ed77916ed4d4833c62e2accdaedfba7) chore: bump sandbox version and cli version ### 📊 Changes **5 files changed** (+244 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-app/helpers/terndoc/pw-test.json` (+2 -1) 📝 `packages/hoppscotch-cli/package.json` (+1 -1) 📝 `packages/hoppscotch-js-sandbox/package.json` (+1 -1) ➕ `packages/hoppscotch-js-sandbox/src/__tests__/testing/expect/toInclude.spec.ts` (+183 -0) 📝 `packages/hoppscotch-js-sandbox/src/test-runner.ts` (+57 -0) </details> ### 📄 Description Closes #2221 ### Description Adds `toInclude` operator to testing suite ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation **(N/A)** - [ ] I have updated the documentation as required **(N/A)** - [x] All the tests have passed ### Additional Information `"123".toInclude(123)` will return `true` even though their types are different (`string` vs. `int`). I included a comment about this, with a link to the [relevant JS spec](https://tc39.es/ecma262/multipage/text-processing.html#sec-string.prototype.includes). If this is an issue, we should switch to `indexOf` instead of `includes`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:16:34 +03:00
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#3681
No description provided.