mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #4657] test(cli): migrate unit tests to vitest #4895
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#4895
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?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/4657
Author: @SnazofSnaz
Created: 1/4/2025
Status: 🔄 Open
Base:
next← Head:main📝 Commits (5)
0781bafchore(cli): update files to utilize vitest syntax directly; improve readme for testing guidef930a24test: enable CLI unit tests in CIab4787eMerge branch 'next' into main4b6b975Merge branch 'next' into main149a9ffMerge branch 'next' into main📊 Changes
19 files changed (+179 additions, -132 deletions)
View changed files
📝
packages/hoppscotch-cli/README.md(+11 -1)📝
packages/hoppscotch-cli/src/__tests__/functions/checks/isHoppCLIError.spec.ts(+5 -4)📝
packages/hoppscotch-cli/src/__tests__/functions/checks/isHoppErrnoException.spec.ts(+9 -8)📝
packages/hoppscotch-cli/src/__tests__/functions/collection/collectionsRunner.spec.ts(+12 -12)📝
packages/hoppscotch-cli/src/__tests__/functions/collection/collectionsRunnerResult.spec.ts(+8 -6)📝
packages/hoppscotch-cli/src/__tests__/functions/getters/getDurationInSeconds.spec.ts(+2 -1)📝
packages/hoppscotch-cli/src/__tests__/functions/getters/getEffectiveFinalMetaData.spec.ts(+10 -10)📝
packages/hoppscotch-cli/src/__tests__/functions/mutators/parseCollectionData.spec.ts(+13 -10)📝
packages/hoppscotch-cli/src/__tests__/functions/pre-request/getEffectiveRESTRequest.spec.ts(+5 -5)📝
packages/hoppscotch-cli/src/__tests__/functions/pre-request/getPreRequestMetrics.spec.ts(+4 -2)📝
packages/hoppscotch-cli/src/__tests__/functions/pre-request/preRequestScriptRunner.spec.ts(+5 -4)📝
packages/hoppscotch-cli/src/__tests__/functions/request/delayPromiseFunction.spec.ts(+2 -0)📝
packages/hoppscotch-cli/src/__tests__/functions/request/getRequestMetrics.spec.ts(+1 -0)📝
packages/hoppscotch-cli/src/__tests__/functions/request/processRequest.spec.ts(+30 -21)📝
packages/hoppscotch-cli/src/__tests__/functions/request/requestRunner.spec.ts(+50 -36)📝
packages/hoppscotch-cli/src/__tests__/functions/test/getTestMetrics.spec.ts(+7 -6)📝
packages/hoppscotch-cli/src/__tests__/functions/test/testDescriptorParser.spec.ts(+2 -0)📝
packages/hoppscotch-cli/src/__tests__/functions/test/testRunner.spec.ts(+2 -1)📝
packages/hoppscotch-cli/vitest.config.ts(+1 -5)📄 Description
Update files to utilize Vitest syntax directly; improve readme for testing guide.
Closes #4136
Vitest dependency tested - changed the syntax of many unit tests to directly align with Vitest logic to reduce the reliance of Vitest compatibility layer transforming Jest syntax to Vitest syntax-
What's changed
Notes to reviewers
Some of these listed files will still show error if selected though have been updated, would require more effort in terms of "synchronicity" like setting a default parameter, to completely remedy - tested as are pass all tests but, could offer some improvement going forward. Appears risk of flaky tests could be further reduced within the unit test files directly if addressing from what I read as "synchronicity".
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.