[PR #2300] [MERGED] chore: tests for hoppscotch-cli #3717

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/2300
Author: @devblin
Created: 4/29/2022
Status: Merged
Merged: 5/11/2022
Merged by: @AndrewBastin

Base: mainHead: tests/hopp-cli


📝 Commits (9)

  • fbc11a4 test: updated hopp cli tests
  • a0f723b test: refactor 'test' cmd tests & add tests for some functions
  • bc061f5 test: added tests for requestRunner & updated test cmd in package.json
  • 61e9e89 test: updated hopp cli bin path in commands testing
  • 24c64db test: updated test command
  • f2c16ce test: added tests for some utils functions
  • 31d68c8 fix: pnpm-lock.yaml file
  • 1b86377 chore: bumped CLI dependencies
  • 2c7366f fix: add type definitions to fix test execution

📊 Changes

30 files changed (+1901 additions, -137 deletions)

View changed files

packages/hoppscotch-cli/jest.config.ts (+193 -0)
packages/hoppscotch-cli/jest.setup.ts (+1 -0)
📝 packages/hoppscotch-cli/package.json (+13 -5)
packages/hoppscotch-cli/src/__tests__/commands/test.spec.ts (+64 -0)
packages/hoppscotch-cli/src/__tests__/functions/checks/checkFilePath.spec.ts (+26 -0)
packages/hoppscotch-cli/src/__tests__/functions/checks/isHoppCLIError.spec.ts (+19 -0)
packages/hoppscotch-cli/src/__tests__/functions/checks/isHoppErrnoException.spec.ts (+19 -0)
packages/hoppscotch-cli/src/__tests__/functions/checks/isRESTCollection.spec.ts (+84 -0)
packages/hoppscotch-cli/src/__tests__/functions/collection/collectionsRunner.spec.ts (+116 -0)
packages/hoppscotch-cli/src/__tests__/functions/collection/collectionsRunnerResult.spec.ts (+35 -0)
packages/hoppscotch-cli/src/__tests__/functions/getters/getDurationInSeconds.spec.ts (+24 -0)
packages/hoppscotch-cli/src/__tests__/functions/getters/getEffectiveFinalMetaData.spec.ts (+42 -0)
packages/hoppscotch-cli/src/__tests__/functions/mutators/parseCollectionData.spec.ts (+36 -0)
packages/hoppscotch-cli/src/__tests__/functions/pre-request/getEffectiveRESTRequest.spec.ts (+148 -0)
packages/hoppscotch-cli/src/__tests__/functions/pre-request/getPreRequestMetrics.spec.ts (+24 -0)
packages/hoppscotch-cli/src/__tests__/functions/pre-request/preRequestScriptRunner.spec.ts (+71 -0)
packages/hoppscotch-cli/src/__tests__/functions/request/getRequestMetrics.spec.ts (+24 -0)
packages/hoppscotch-cli/src/__tests__/functions/request/processRequest.spec.ts (+104 -0)
packages/hoppscotch-cli/src/__tests__/functions/request/requestRunner.spec.ts (+111 -0)
packages/hoppscotch-cli/src/__tests__/functions/test/getTestMetrics.spec.ts (+55 -0)

...and 10 more files

📄 Description

Description

Added tests for hoppscotch-cli including:

  • Tests for hopp test command.
  • Tests for some utils functions.

Checks

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

Additional Information


🔄 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/2300 **Author:** [@devblin](https://github.com/devblin) **Created:** 4/29/2022 **Status:** ✅ Merged **Merged:** 5/11/2022 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `main` ← **Head:** `tests/hopp-cli` --- ### 📝 Commits (9) - [`fbc11a4`](https://github.com/hoppscotch/hoppscotch/commit/fbc11a468f54ea9c940fd6609981190b644b955f) test: updated hopp cli tests - [`a0f723b`](https://github.com/hoppscotch/hoppscotch/commit/a0f723b484630cb19b31b16a7b5dcf069e68cc07) test: refactor 'test' cmd tests & add tests for some functions - [`bc061f5`](https://github.com/hoppscotch/hoppscotch/commit/bc061f5dccfbbc41d301324564f9a57ac5a28e0d) test: added tests for requestRunner & updated test cmd in package.json - [`61e9e89`](https://github.com/hoppscotch/hoppscotch/commit/61e9e89fdc682b206cd75d6958ec816f7c8fa12f) test: updated hopp cli bin path in commands testing - [`24c64db`](https://github.com/hoppscotch/hoppscotch/commit/24c64db01a83e6743e42bc40017a3d6cd9d46754) test: updated test command - [`f2c16ce`](https://github.com/hoppscotch/hoppscotch/commit/f2c16ce12692b5aa38b6cbbfd66daed244c21dd7) test: added tests for some utils functions - [`31d68c8`](https://github.com/hoppscotch/hoppscotch/commit/31d68c80d4a88c4e4fd1fef6fa121968a0e23372) fix: pnpm-lock.yaml file - [`1b86377`](https://github.com/hoppscotch/hoppscotch/commit/1b863777a2f40333766a9c29bd3b4cb7e492bb3d) chore: bumped CLI dependencies - [`2c7366f`](https://github.com/hoppscotch/hoppscotch/commit/2c7366f7ccc70dd843c39b045ee4f3f15b1b909c) fix: add type definitions to fix test execution ### 📊 Changes **30 files changed** (+1901 additions, -137 deletions) <details> <summary>View changed files</summary> ➕ `packages/hoppscotch-cli/jest.config.ts` (+193 -0) ➕ `packages/hoppscotch-cli/jest.setup.ts` (+1 -0) 📝 `packages/hoppscotch-cli/package.json` (+13 -5) ➕ `packages/hoppscotch-cli/src/__tests__/commands/test.spec.ts` (+64 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/checks/checkFilePath.spec.ts` (+26 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/checks/isHoppCLIError.spec.ts` (+19 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/checks/isHoppErrnoException.spec.ts` (+19 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/checks/isRESTCollection.spec.ts` (+84 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/collection/collectionsRunner.spec.ts` (+116 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/collection/collectionsRunnerResult.spec.ts` (+35 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/getters/getDurationInSeconds.spec.ts` (+24 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/getters/getEffectiveFinalMetaData.spec.ts` (+42 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/mutators/parseCollectionData.spec.ts` (+36 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/pre-request/getEffectiveRESTRequest.spec.ts` (+148 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/pre-request/getPreRequestMetrics.spec.ts` (+24 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/pre-request/preRequestScriptRunner.spec.ts` (+71 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/request/getRequestMetrics.spec.ts` (+24 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/request/processRequest.spec.ts` (+104 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/request/requestRunner.spec.ts` (+111 -0) ➕ `packages/hoppscotch-cli/src/__tests__/functions/test/getTestMetrics.spec.ts` (+55 -0) _...and 10 more files_ </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> ### Description Added tests for hoppscotch-cli including: - Tests for `hopp test` command. - Tests for some `utils` functions. <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [x] Not Completed - [] Completed --> ### 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 - [x] My code requires changes to the documentation - [ ] I have updated the documentation as required - [ ] All the tests have passed ### Additional Information <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behavior, etc. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:18:29 +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#3717
No description provided.