Skip to content

Commit

Permalink
fisk tests2
Browse files Browse the repository at this point in the history
  • Loading branch information
mindler-sasu committed Sep 30, 2022
1 parent 0195ada commit 9920bf3
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions src/validatePrTitle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,47 @@ it("allows valid PR titles that use the default types", async () => {
});

it("throws for PR titles without a ticket", async () => {
await expect(
validatePrTitle("Fix bug", { teams, ignoreLabels })
).resolves.toEqual(false);
await expect(validatePrTitle("Fix bug", { teams, ignoreLabels })).toEqual(
false
);
});
it("throws for PR titles without a ticket number", async () => {
await expect(
validatePrTitle("DNA: bug", { teams, ignoreLabels })
).resolves.toEqual(false);
await expect(validatePrTitle("DNA: bug", { teams, ignoreLabels })).toEqual(
false
);
});
it("throws for PR titles without a ticket number2", async () => {
await expect(
validatePrTitle("DNA-: bug", { teams, ignoreLabels })
).resolves.toEqual(false);
});
it("throws for empty titles", async () => {
await expect(validatePrTitle("", { teams, ignoreLabels })).resolves.toEqual(
await expect(validatePrTitle("DNA-: bug", { teams, ignoreLabels })).toEqual(
false
);
});
it("throws for empty titles", async () => {
await expect(validatePrTitle("", { teams, ignoreLabels })).toEqual(false);
});

it("works for PR titles with ticket presented not in start", async () => {
await expect(
validatePrTitle("doing stuff for salary DNA-123 lol", {
teams,
ignoreLabels,
})
).resolves.toEqual(true);
).toEqual(true);
});
it("works for PR titles with ticket number underscored", async () => {
await expect(
validatePrTitle("doing stuff for salary DNA_123 lol", {
teams,
ignoreLabels,
})
).resolves.toEqual(true);
).toEqual(true);
});
it("works for PR titles with ticket number spaced", async () => {
await expect(
validatePrTitle("doing stuff for salary DNA 123 lol", {
teams,
ignoreLabels,
})
).resolves.toEqual(true);
).toEqual(true);
});

it("doesnt throw if ignoreLabel ninja is in place", async () => {
Expand All @@ -66,7 +64,7 @@ it("doesnt throw if ignoreLabel ninja is in place", async () => {
teams,
ignoreLabels,
})
).resolves.toEqual(true);
).toEqual(true);
});

it("doesnt throw if ignoreLabel fire is in place", async () => {
Expand All @@ -75,21 +73,21 @@ it("doesnt throw if ignoreLabel fire is in place", async () => {
teams,
ignoreLabels,
})
).resolves.toEqual(true);
).toEqual(true);
});
it("doesnt throw if ignoreLabel running with scissors is in place", async () => {
await expect(
validatePrTitle(
"[running with scissors] they seee me merginn' they hatin'",
{ teams, ignoreLabels }
)
).resolves.toEqual(true);
).toEqual(true);
});
it("doesnt throw if ignoreLabel chore is in place", async () => {
await expect(
validatePrTitle("[chore] they seee me merginn' they hatin'", {
teams,
ignoreLabels,
})
).resolves.toEqual(true);
).toEqual(true);
});

0 comments on commit 9920bf3

Please sign in to comment.