Skip to content

Commit

Permalink
you published WHAT?
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed May 25, 2024
1 parent e748806 commit 2f9b1cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ export async function handlePublish(
});
}

if (zlsVersion.major !== 0) {
return new Response(`WHAT?!?!?!?!`, {
status: 418, // I'm a teapot
});
}

if (
artifacts.length !== 0 &&
!artifacts.every((artifact) => artifact.version === artifacts[0].version)
Expand Down
11 changes: 11 additions & 0 deletions test/publish.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,17 @@ describe("/v1/publish", () => {
}
});

test("try to publish ZLS 1.0.0", async () => {
const response = await sendPublish({
zlsVersion: "1.0.0",
zigVersion: "1.0.0",
artifacts: [
["zls-linux-x86_64-0.1.0.tar.xz", new Blob([xzMagicNumber, "binary1"])],
],
});
expect(response.status).toBe(418);
});

test("publish new successfull build", async () => {
const date = Date.now();
vi.setSystemTime(date);
Expand Down

0 comments on commit 2f9b1cc

Please sign in to comment.