Skip to content

Commit

Permalink
Fix path separators
Browse files Browse the repository at this point in the history
  • Loading branch information
John Simons committed Mar 28, 2022
1 parent 77a3975 commit 66a68fc
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions source/tasks/OctoInstaller/OctoInstallerV5/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,25 @@ describe("OctoInstaller", () => {

test("Installs specific version", async () => {
const output = await executeCommand(() => new Installer(octopusUrl).run("8.0.0"));
expect(output).toContain("/8.0.0/OctopusTools.");
expect(output).toContain("/octo/8.0.0");
assertions(output, "8.0.0");
});

test("Installs wildcard version", async () => {
const output = await executeCommand(() => new Installer(octopusUrl).run("7.*"));
expect(output).toContain("/7.4.1/OctopusTools.");
expect(output).toContain("/octo/7.4.1");
assertions(output, "7.4.1");
});

test("Installs latest of latest", async () => {
const output = await executeCommand(() => new Installer(octopusUrl).run("*"));
expect(output).toContain("/8.2.0/OctopusTools.");
expect(output).toContain("/octo/8.2.0");
assertions(output, "8.2.0");
});

function assertions(output: string, version: string) {
expect(output).toContain(toPath([version, "OctopusTools."]));
expect(output).toContain(toPath(["octo", version]));
}

function toPath(parts: string[]) {
return `${path.sep}${parts.join(path.sep)}`;
}
});

0 comments on commit 66a68fc

Please sign in to comment.