Skip to content

Commit 66a68fc

Browse files
author
John Simons
committed
Fix path separators
1 parent 77a3975 commit 66a68fc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

source/tasks/OctoInstaller/OctoInstallerV5/installer.test.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,25 @@ describe("OctoInstaller", () => {
9494

9595
test("Installs specific version", async () => {
9696
const output = await executeCommand(() => new Installer(octopusUrl).run("8.0.0"));
97-
expect(output).toContain("/8.0.0/OctopusTools.");
98-
expect(output).toContain("/octo/8.0.0");
97+
assertions(output, "8.0.0");
9998
});
10099

101100
test("Installs wildcard version", async () => {
102101
const output = await executeCommand(() => new Installer(octopusUrl).run("7.*"));
103-
expect(output).toContain("/7.4.1/OctopusTools.");
104-
expect(output).toContain("/octo/7.4.1");
102+
assertions(output, "7.4.1");
105103
});
106104

107105
test("Installs latest of latest", async () => {
108106
const output = await executeCommand(() => new Installer(octopusUrl).run("*"));
109-
expect(output).toContain("/8.2.0/OctopusTools.");
110-
expect(output).toContain("/octo/8.2.0");
107+
assertions(output, "8.2.0");
111108
});
109+
110+
function assertions(output: string, version: string) {
111+
expect(output).toContain(toPath([version, "OctopusTools."]));
112+
expect(output).toContain(toPath(["octo", version]));
113+
}
114+
115+
function toPath(parts: string[]) {
116+
return `${path.sep}${parts.join(path.sep)}`;
117+
}
112118
});

0 commit comments

Comments
 (0)