Skip to content

Commit 4222bfb

Browse files
Using OS-specifc root paths, to test properly on Windows
1 parent a188b9c commit 4222bfb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/specs/absolute-root/absolute-root.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
22

33
const { expect } = require("chai");
4+
const { resolve } = require("path");
45
const $RefParser = require("../../..");
56
const path = require("../../utils/path");
67
const helper = require("../../utils/helper");
@@ -10,6 +11,9 @@ const dereferencedSchema = require("./dereferenced");
1011
const bundledSchema = require("./bundled");
1112

1213
describe("When executed in the context of root directory", () => {
14+
// Store the OS root directory
15+
const root = resolve("/");
16+
1317
// Store references to the original methods
1418
const originalProcessCwd = process.cwd;
1519
const originalUrlCwd = url.cwd;
@@ -18,7 +22,7 @@ describe("When executed in the context of root directory", () => {
1822
* A mock `process.cwd()` implementation that always returns the root diretory
1923
*/
2024
function mockProcessCwd () {
21-
return "/";
25+
return root;
2226
}
2327

2428
/**

0 commit comments

Comments
 (0)