[PR #2373] [MERGED] feat: added support for passing env.json file to test cmd #3766

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/2373
Author: @devblin
Created: 5/28/2022
Status: Merged
Merged: 6/15/2022
Merged by: @AndrewBastin

Base: mainHead: feat/env-option


📝 Commits (4)

  • 475f1bc feat: added support for passing env.json file to test cmd
  • d911260 refactor: updated README.md and required arg naming for test cmd
  • d5484f9 fix: updated pnpm-lock.yaml file
  • 2fa3b3f refactor: updated with requested changees

📊 Changes

20 files changed (+308 additions, -95 deletions)

View changed files

📝 packages/hoppscotch-cli/README.md (+14 -1)
📝 packages/hoppscotch-cli/src/__tests__/commands/test.spec.ts (+41 -2)
📝 packages/hoppscotch-cli/src/__tests__/functions/checks/checkFile.spec.ts (+8 -6)
📝 packages/hoppscotch-cli/src/__tests__/functions/collection/collectionsRunner.spec.ts (+45 -32)
📝 packages/hoppscotch-cli/src/__tests__/functions/getters/getEffectiveFinalMetaData.spec.ts (+2 -0)
📝 packages/hoppscotch-cli/src/__tests__/functions/mutators/parseCollectionData.spec.ts (+4 -2)
📝 packages/hoppscotch-cli/src/__tests__/functions/pre-request/getEffectiveRESTRequest.spec.ts (+2 -0)
packages/hoppscotch-cli/src/__tests__/samples/env-flag-envs.json (+7 -0)
packages/hoppscotch-cli/src/__tests__/samples/env-flag-tests.json (+22 -0)
📝 packages/hoppscotch-cli/src/commands/test.ts (+6 -5)
📝 packages/hoppscotch-cli/src/handlers/error.ts (+4 -3)
📝 packages/hoppscotch-cli/src/index.ts (+11 -5)
packages/hoppscotch-cli/src/options/test/env.ts (+64 -0)
packages/hoppscotch-cli/src/types/collections.ts (+9 -0)
packages/hoppscotch-cli/src/types/commands.ts (+5 -0)
📝 packages/hoppscotch-cli/src/types/errors.ts (+2 -1)
📝 packages/hoppscotch-cli/src/types/request.ts (+4 -8)
📝 packages/hoppscotch-cli/src/utils/checks.ts (+40 -22)
📝 packages/hoppscotch-cli/src/utils/collections.ts (+7 -4)
📝 packages/hoppscotch-cli/src/utils/mutators.ts (+11 -4)

📄 Description

Closes #2333

Description

  • Added support for passing external ENV data through env.json file while using hopp test cmd on collection.json file.
  • Updated and refactored tests for CLI and realted functions.
  • Updated README.md with usage detail for -e / --env option with hopp test cmd.

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

🔄 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/2373 **Author:** [@devblin](https://github.com/devblin) **Created:** 5/28/2022 **Status:** ✅ Merged **Merged:** 6/15/2022 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `main` ← **Head:** `feat/env-option` --- ### 📝 Commits (4) - [`475f1bc`](https://github.com/hoppscotch/hoppscotch/commit/475f1bc8ff277245820eca0c5b72b638c1a171b9) feat: added support for passing env.json file to test cmd - [`d911260`](https://github.com/hoppscotch/hoppscotch/commit/d911260318d2c275dbca98d4dc1512dd8a67132f) refactor: updated README.md and required arg naming for test cmd - [`d5484f9`](https://github.com/hoppscotch/hoppscotch/commit/d5484f99eaff6d72a9ed52d16f56ca855610647f) fix: updated pnpm-lock.yaml file - [`2fa3b3f`](https://github.com/hoppscotch/hoppscotch/commit/2fa3b3f543a75d40dfd28507dd5c6081c9fb490b) refactor: updated with requested changees ### 📊 Changes **20 files changed** (+308 additions, -95 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-cli/README.md` (+14 -1) 📝 `packages/hoppscotch-cli/src/__tests__/commands/test.spec.ts` (+41 -2) 📝 `packages/hoppscotch-cli/src/__tests__/functions/checks/checkFile.spec.ts` (+8 -6) 📝 `packages/hoppscotch-cli/src/__tests__/functions/collection/collectionsRunner.spec.ts` (+45 -32) 📝 `packages/hoppscotch-cli/src/__tests__/functions/getters/getEffectiveFinalMetaData.spec.ts` (+2 -0) 📝 `packages/hoppscotch-cli/src/__tests__/functions/mutators/parseCollectionData.spec.ts` (+4 -2) 📝 `packages/hoppscotch-cli/src/__tests__/functions/pre-request/getEffectiveRESTRequest.spec.ts` (+2 -0) ➕ `packages/hoppscotch-cli/src/__tests__/samples/env-flag-envs.json` (+7 -0) ➕ `packages/hoppscotch-cli/src/__tests__/samples/env-flag-tests.json` (+22 -0) 📝 `packages/hoppscotch-cli/src/commands/test.ts` (+6 -5) 📝 `packages/hoppscotch-cli/src/handlers/error.ts` (+4 -3) 📝 `packages/hoppscotch-cli/src/index.ts` (+11 -5) ➕ `packages/hoppscotch-cli/src/options/test/env.ts` (+64 -0) ➕ `packages/hoppscotch-cli/src/types/collections.ts` (+9 -0) ➕ `packages/hoppscotch-cli/src/types/commands.ts` (+5 -0) 📝 `packages/hoppscotch-cli/src/types/errors.ts` (+2 -1) 📝 `packages/hoppscotch-cli/src/types/request.ts` (+4 -8) 📝 `packages/hoppscotch-cli/src/utils/checks.ts` (+40 -22) 📝 `packages/hoppscotch-cli/src/utils/collections.ts` (+7 -4) 📝 `packages/hoppscotch-cli/src/utils/mutators.ts` (+11 -4) </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. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes #2333 ### Description - Added support for passing external ENV data through env.json file while using `hopp test` cmd on collection.json file. - Updated and refactored tests for CLI and realted functions. - Updated README.md with usage detail for `-e / --env` option with `hopp test` cmd. <!-- 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 - [ ] Not Completed - [x] 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 - [x] I have updated the documentation as required - [x] All the tests have passed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:21:14 +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#3766
No description provided.