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; } };