mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #4520] [bug]: hoppscotch-cli errors on npm test for Windows machine #1654
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#1654
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?
Originally created by @Leon-Luu on GitHub (Nov 7, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4520
Is there an existing issue for this?
Current behavior
In windows machine I got 100% errors related to packages\hoppscotch-cli when performs npm test (the same error is not seen on ubuntu)
Computer info:
windows 11
v18.15.0
Error info:
✓ src/tests/unit/getters.spec.ts (21 tests) 53ms
│ (node:39192) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
│ (Use node --trace-deprecation ... to show where the warning was created)
│ ❯ src/tests/e2e/commands/test.spec.ts (45 tests | 5 failed) 99961ms
│ × hopp test [options] <file_path_or_id> > Test hopp test <file_path_or_id> --env <file_path_or_id> command: > AWS Signature Authorization type > Successfully translates the authorization information to headers/query params and sends …
│ → expected Error: Command failed: node F:\develop\te… { …(4) } to be null
│ × hopp test [options] <file_path_or_id> > Test hopp test <file_path_or_id> --env <file_path_or_id> command: > Digest Authorization type > Successfully translates the authorization information to headers/query params and sends it alon…
│ → expected Error: Command failed: node F:\develop\te… { …(4) } to be null
│ × hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id> --reporter-junit [path] > Report export fails with the code REPORT_EXPORT_FAILED while encountering an error during path creation │ → expected '' to be 'REPORT_EXPORT_FAILED' // Object.is equality │ × hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id> --reporter-junit [path] > Generates a JUnit report at the default path
│ → Snapshot hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id> --reporter-junit [path] > Generates a JUnit report at the default path 1 mismatched │ × hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id> --reporter-junit [path] > Generates a JUnit report at the specified path
│ → Snapshot hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id> --reporter-junit [path] > Generates a JUnit report at the specified path 1mismatched │ ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 5 ⎯⎯⎯⎯⎯⎯⎯ │ FAIL src/tests/e2e/commands/test.spec.ts > hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id>command: > AWS Signature Authorization type > Successfully translates the authorization in… │ AssertionError: expected Error: Command failed: node F:\develop\te… { …(4) } to be null │ ❯ src/tests/e2e/commands/test.spec.ts:418:23 │ 416| const { error } = await runCLI(args, { env }); │ 417| │ 418| expect(error).toBeNull(); │ | ^ │ 419| }); │ 420| }); │ ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/5]⎯ │ FAIL src/tests/e2e/commands/test.spec.ts > hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id> command: > Digest Authorization type > Successfully translates the authorization informati… │ AssertionError: expected Error: Command failed: node F:\develop\te… { …(4) } to be null │ ❯ src/tests/e2e/commands/test.spec.ts:436:23 │ 434| const { error } = await runCLI(args); │ 435| │ 436| expect(error).toBeNull(); │ | ^ │ 437| }); │ 438| }); │ ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/5]⎯ │ FAIL src/tests/e2e/commands/test.spec.ts > hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id> --reporter-junit [path] > Report export fails with the code REPORT_EXPORT_FAILED while enc…
│ AssertionError: expected '' to be 'REPORT_EXPORT_FAILED' // Object.is equality
│ - Expected
│ + Received
│ - REPORT_EXPORT_FAILED
│ ❯ src/tests/e2e/commands/test.spec.ts:662:19
│ 660|
│ 661| const out = getErrorCode(stderr);
│ 662| expect(out).toBe("REPORT_EXPORT_FAILED");
│ | ^
│ 663|
│ 664| expect(stdout).not.toContain(
│ ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/5]⎯
│ FAIL src/tests/e2e/commands/test.spec.ts > hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id> --reporter-junit [path] > Generates a JUnit report at the default path │ Error: Snapshot hopp test [options] <file_path_or_id> > Testhopp test <file_path_or_id> --env <file_path_or_id> --reporter-junit [path] > Generates a JUnit report at the default path 1 mismatched
│ - Expected
│ + Received
│ @@ -1,10 +1,10 @@
│ "
│
│
│
│ + REQUEST_ERROR - TypeError [ERR_INVALID_URL]: Invalid URL]]>
│
│
│
│
│
│ @@ -70,11 +70,11 @@
│
│
│
│
│
│
│
│ hopp test [options] > Test
hopp test --env --reporter-junit [path] > Generates a JUnit report at the specified path │ Error: Snapshothopp test [options] > Testhopp test --env --reporter-junit [path] > Generates a JUnit report at the specified path 1mismatched │ - Expected │ + Received │ @@ -1,10 +1,10 @@ │ " │ │ ││ + REQUEST_ERROR - TypeError [ERR_INVALID_URL]: Invalid URL]]>
│
│
│
│
│
│ @@ -70,11 +70,11 @@
│
│
│
│
│
│
│
│ <![CDATA[
│ PARSING_ERROR - {
│ ❯ src/tests/e2e/commands/test.spec.ts:724:55
│ 722| .toString();
│ 723|
│ 724| expect(replaceDynamicValuesInStr(fileContents)).toMatchSnapshot(…
│ | ^
│ 725| });
│ 726|
│ ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/5]⎯
│ ELIFECYCLE Test failed. See above for more details.
Steps to reproduce
Environment
Production
Version
Cloud
@ImNicolasTheDev commented on GitHub (Nov 20, 2024):
Hi there!
It seems like the path you are exporting the report to is incorrect. Could you make sure to try both relative and absolute paths?
Also, maybe your path contains special characters that could prevent the path to be found correctly...
@Leon-Luu commented on GitHub (Nov 21, 2024):
We shouldn't do any more than that do pnpm test on either root folder or packages\hoppscotch-cli folder. This has been working earlier in Windows.
@ImNicolasTheDev commented on GitHub (Nov 21, 2024):
You should find information here : https://docs.hoppscotch.io/documentation/clients/cli/overview#windows-and-macos
On Windows, you should run
hopp test <hoppscotch-collection-file> --reporter-junit [path_to_export_report]Note that you can add other arguments, you can find them here : https://docs.hoppscotch.io/documentation/clients/cli/overview#arguments
Hope that helps! 😉
@Leon-Luu commented on GitHub (Nov 22, 2024):
@ImNicolasTheDev seems like you had misunderstood the problem here. It is about the test cases errors on https://github.com/hoppscotch/hoppscotch/tree/main/packages/hoppscotch-cli/src/tests while executing the test on windows. It is NOT about using the CLI, there is no problem there.