[PR #3116] [CLOSED] test: improved backend unit test cases #4235

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3116
Author: @mirarifhasan
Created: 6/6/2023
Status: Closed

Base: mainHead: fix/backend-test-case


📝 Commits (10+)

  • c4479b9 feat: missing test case added for admin service
  • 6e17d08 test: improved test coverage for team-request
  • 1021806 fix: isLeft check in admin service
  • d21f671 test: unit test coverage added for team-collection
  • cac1719 test: improved test coverage for user-req
  • b1bea8d test: improved user-collection unit test cases
  • c59217a fix: timing dependency on test case (#3070)
  • c40c22e fix: analytics logging behavior being incorrect (#3064)
  • 540283c fix: don't cut off the part that's already been typed (#3054)
  • 999117a Fix typo, rename cuttentTime to currentTime (#3053)

📊 Changes

60 files changed (+3250 additions, -687 deletions)

View changed files

📝 .env.example (+1 -1)
📝 package.json (+1 -1)
📝 packages/hoppscotch-backend/package.json (+1 -1)
📝 packages/hoppscotch-backend/src/admin/admin.service.spec.ts (+584 -0)
📝 packages/hoppscotch-backend/src/admin/admin.service.ts (+1 -1)
📝 packages/hoppscotch-backend/src/main.ts (+0 -1)
📝 packages/hoppscotch-backend/src/team-collection/team-collection.service.spec.ts (+184 -4)
📝 packages/hoppscotch-backend/src/team-invitation/team-invitation.service.ts (+1 -1)
📝 packages/hoppscotch-backend/src/team-request/team-request.service.spec.ts (+90 -9)
📝 packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts (+485 -1)
📝 packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts (+5 -3)
📝 packages/hoppscotch-backend/src/user-request/user-request.service.spec.ts (+98 -0)
📝 packages/hoppscotch-backend/src/user-request/user-request.service.ts (+3 -1)
📝 packages/hoppscotch-common/assets/scss/themes.scss (+3 -0)
📝 packages/hoppscotch-common/locales/cn.json (+40 -40)
📝 packages/hoppscotch-common/locales/en.json (+2 -0)
📝 packages/hoppscotch-common/locales/es.json (+138 -138)
📝 packages/hoppscotch-common/meta.ts (+14 -2)
📝 packages/hoppscotch-common/package.json (+2 -1)
packages/hoppscotch-common/public/icons/pwa-1024x1024.png (+0 -0)

...and 40 more files

📄 Description

Closes HBE-203

Description

In this PR, we add a few test cases to improve our test coverage throughout hoppscotch-backend. Unit test cases added for the following modules:

  1. Admin Module
  2. Team Collection Module
  3. Team Request Module
  4. User Collection Module
  5. User Request Module

How to run test cases

Just run the backend test cases, sometime you will get this issue.

cd packages/hoppscotch-backend
npm run test

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

Nil


🔄 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/3116 **Author:** [@mirarifhasan](https://github.com/mirarifhasan) **Created:** 6/6/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/backend-test-case` --- ### 📝 Commits (10+) - [`c4479b9`](https://github.com/hoppscotch/hoppscotch/commit/c4479b9103f66510ac525ccac83b5284e4c2ace3) feat: missing test case added for admin service - [`6e17d08`](https://github.com/hoppscotch/hoppscotch/commit/6e17d0816ec5aa76e083d41e3fdc86e158669d2b) test: improved test coverage for team-request - [`1021806`](https://github.com/hoppscotch/hoppscotch/commit/102180604bbfb26db7320b9183113ab22b984f2a) fix: isLeft check in admin service - [`d21f671`](https://github.com/hoppscotch/hoppscotch/commit/d21f671adfa9875868a96da0b454691d104f79c2) test: unit test coverage added for team-collection - [`cac1719`](https://github.com/hoppscotch/hoppscotch/commit/cac17194b4b00fb00ff3957e0afc9cd99687ee92) test: improved test coverage for user-req - [`b1bea8d`](https://github.com/hoppscotch/hoppscotch/commit/b1bea8d8851946d40af820123dfdb2bf519464e5) test: improved user-collection unit test cases - [`c59217a`](https://github.com/hoppscotch/hoppscotch/commit/c59217a419e47eaed140e610d96e4dbc4a65e6d8) fix: timing dependency on test case (#3070) - [`c40c22e`](https://github.com/hoppscotch/hoppscotch/commit/c40c22e87deaed2abe4b463fb0d9aae7991b1fc0) fix: analytics logging behavior being incorrect (#3064) - [`540283c`](https://github.com/hoppscotch/hoppscotch/commit/540283ce9a5434dda5ac4c8abdbcdeb1f93b6ba8) fix: don't cut off the part that's already been typed (#3054) - [`999117a`](https://github.com/hoppscotch/hoppscotch/commit/999117a57656e298d07a71f3626214adfbb47002) Fix typo, rename cuttentTime to currentTime (#3053) ### 📊 Changes **60 files changed** (+3250 additions, -687 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+1 -1) 📝 `package.json` (+1 -1) 📝 `packages/hoppscotch-backend/package.json` (+1 -1) 📝 `packages/hoppscotch-backend/src/admin/admin.service.spec.ts` (+584 -0) 📝 `packages/hoppscotch-backend/src/admin/admin.service.ts` (+1 -1) 📝 `packages/hoppscotch-backend/src/main.ts` (+0 -1) 📝 `packages/hoppscotch-backend/src/team-collection/team-collection.service.spec.ts` (+184 -4) 📝 `packages/hoppscotch-backend/src/team-invitation/team-invitation.service.ts` (+1 -1) 📝 `packages/hoppscotch-backend/src/team-request/team-request.service.spec.ts` (+90 -9) 📝 `packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts` (+485 -1) 📝 `packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts` (+5 -3) 📝 `packages/hoppscotch-backend/src/user-request/user-request.service.spec.ts` (+98 -0) 📝 `packages/hoppscotch-backend/src/user-request/user-request.service.ts` (+3 -1) 📝 `packages/hoppscotch-common/assets/scss/themes.scss` (+3 -0) 📝 `packages/hoppscotch-common/locales/cn.json` (+40 -40) 📝 `packages/hoppscotch-common/locales/en.json` (+2 -0) 📝 `packages/hoppscotch-common/locales/es.json` (+138 -138) 📝 `packages/hoppscotch-common/meta.ts` (+14 -2) 📝 `packages/hoppscotch-common/package.json` (+2 -1) ➕ `packages/hoppscotch-common/public/icons/pwa-1024x1024.png` (+0 -0) _...and 40 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. --> <!-- If this pull request closes an issue, please mention the issue number below --> <!-- Issue # here --> Closes HBE-203 ### Description <!-- Add a brief description of the pull request --> In this PR, we add a few test cases to improve our test coverage throughout `hoppscotch-backend`. Unit test cases added for the following modules: 1. Admin Module 2. Team Collection Module 3. Team Request Module 4. User Collection Module 5. User Request Module <!-- 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 --> ### How to run test cases Just run the backend test cases, sometime you will get this issue. ``` cd packages/hoppscotch-backend npm run test ``` ### 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 - [ ] I have updated the documentation as required - [x] All the tests have passed ### Additional Information <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behaviour, etc. --> Nil --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:47:17 +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#4235
No description provided.