Skip to content

Commit

Permalink
test: add test for common defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Dec 23, 2024
1 parent 0ac07ba commit 247c5cc
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/createThreadFilter.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it, test } from "vitest";

import { createThreadFilter } from "./createThreadFilter.js";

Expand Down Expand Up @@ -50,4 +50,32 @@ describe("createThreadFilter", () => {

expect(actual).toBe(true);
});

test("common defaults", () => {
const filter = createThreadFilter({
reason: new Set(["subscribed"]),
title: [/^chore\(deps\): update .+ to/, /^build\(deps-dev\): bump .+ to/],
});

const threads = [
{
reason: "subscribed",
subject: {
title: "chore(deps): update pnpm to v9.15.1",
type: "PullRequest",
},
},
{
reason: "subscribed",
subject: {
title: "build(deps-dev): bump esbuild from 0.24.1 to 0.24.2",
type: "PullRequest",
},
},
];

const actual = threads.filter(filter);

expect(actual).toEqual(threads);
});
});

0 comments on commit 247c5cc

Please sign in to comment.