From 2923193284077608ca18cbba1c6e24a9b00547fb Mon Sep 17 00:00:00 2001 From: JonLuca DeCaro Date: Thu, 10 Oct 2024 15:23:18 -0700 Subject: [PATCH] more windows issues --- test/specs/object-source/object-source.spec.js | 4 ++-- test/utils/path.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/specs/object-source/object-source.spec.js b/test/specs/object-source/object-source.spec.js index 9ec59438..b9deb0bf 100644 --- a/test/specs/object-source/object-source.spec.js +++ b/test/specs/object-source/object-source.spec.js @@ -20,8 +20,8 @@ describe("Object sources (instead of file paths)", () => { path.abs("specs/object-source/definitions/definitions.json"), path.abs("specs/object-source/definitions/name.yaml"), path.abs("specs/object-source/definitions/required-string.yaml") - ]; - expect(parser.$refs.paths()).to.have.same.members(expectedPaths); + ].sort(); + expect(parser.$refs.paths().sort()).to.have.same.members(expectedPaths); expect(parser.$refs.values()).to.have.keys(expectedPaths); // Reference equality expect(api.paths["/people/{name}"].get.responses["200"].schema) diff --git a/test/utils/path.js b/test/utils/path.js index 7fd02aa4..9ad93035 100644 --- a/test/utils/path.js +++ b/test/utils/path.js @@ -65,7 +65,11 @@ function filesystemPathHelpers () { * Returns the absolute path of the current working directory. */ cwd () { - return nodePath.join(process.cwd(), nodePath.sep); + let file = nodePath.join(process.cwd(), nodePath.sep); + if (isWindows) { + file = file.replace(/\\/g, "/"); // Convert Windows separators to URL separators + } + return file; } };