Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix(cli): use os-specific invalid paths for tests (#4518)

Shreyas3de3209d5e8a
diff --git a/packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts b/packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts
index ef8497e03..ac89236ca 100644
--- a/packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts
+++ b/packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts
@@ -644,7 +644,11 @@ describe("hopp test [options] <file_path_or_id>", { timeout: 100000 }, () => {
const COLL_PATH = getTestJsonFilePath("passes-coll.json", "collection");
- const args = `test ${COLL_PATH} --reporter-junit /non-existent-path/report.xml`;
+ const invalidPath = process.platform === 'win32'
+ ? 'Z:/non-existent-path/report.xml'
+ : '/non-existent/report.xml';
+
+ const args = `test ${COLL_PATH} --reporter-junit ${invalidPath}`;
const { stdout, stderr } = await runCLI(args, {
cwd: path.resolve("hopp-cli-test"),