Skip to content

Commit eb34483

Browse files
committed
test: cover Windows convention paths
1 parent ef46ded commit eb34483

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎tests/combine/test-specs.test.mjs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,24 @@ test("uses the adjacent test checkout by default", async () => {
6262
expect(directoriesRead).toContain("/workspace/test/specs/conventions");
6363
});
6464

65+
test("uses Windows paths for the adjacent test checkout when requested", async () => {
66+
const directoriesRead = [];
67+
const root = "C:\\workspace\\codescope";
68+
const specsRoot = "C:\\workspace\\test\\specs\\conventions";
69+
const result = await combineTestSpecs(root, {
70+
platform: "win32",
71+
readPackageJson: async () => JSON.stringify({ eliware: { apply: ["general"] } }),
72+
readDirectory: async (directory) => {
73+
directoriesRead.push(directory);
74+
return directory === specsRoot ? [{ name: "general-semantic.yaml", isFile: () => true }] : [];
75+
},
76+
inspectFile: regularFile,
77+
readFileContents: async () => "version: 15.0\nsource: windows",
78+
});
79+
expect(result).toContain("source: windows");
80+
expect(directoriesRead).toContain(specsRoot);
81+
});
82+
6583
test("reports selected profiles missing from the supplied specifications", async () => {
6684
await expect(
6785
combineTestSpecs("/repo", {

0 commit comments

Comments
 (0)