mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
29 lines
718 B
TypeScript
29 lines
718 B
TypeScript
import type { HttpdClient } from "@http-client";
|
|
|
|
import { expect } from "vitest";
|
|
import isMatch from "lodash/isMatch";
|
|
|
|
import { cobRid } from "@tests/support/fixtures";
|
|
|
|
export async function assertIssue(
|
|
oid: string,
|
|
change: Record<string, unknown>,
|
|
api: HttpdClient,
|
|
) {
|
|
expect(
|
|
//@prettier-ignore looks more readable than what prettier suggests.
|
|
isMatch(await api.repo.getIssueById(cobRid, oid), change),
|
|
).toBe(true);
|
|
}
|
|
|
|
export async function assertPatch(
|
|
oid: string,
|
|
change: Record<string, unknown>,
|
|
api: HttpdClient,
|
|
) {
|
|
expect(
|
|
//@prettier-ignore looks more readable than what prettier suggests.
|
|
isMatch(await api.repo.getPatchById(cobRid, oid), change),
|
|
).toBe(true);
|
|
}
|