Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566import { describe, expect, it,} from '@monochromatic-dev/module-test/ts';
import { preflightPublication, type GitHubApiClient,} from '../dist/final/node/index.mjs';
await describe({ name: preflightPublication.name, children: [ it({ name: 'selects title prefix and verified commit source link', fn: async () => { /** Endpoints observed by fake GitHub API. */ const endpoints: string[] = []; /** Fake API returning absent label and verified commit. */ const api: GitHubApiClient = async (request,) => { endpoints.push(request.endpoint,); if (request.endpoint.endsWith('/labels/needs-triage',)) { return { status: 404, headers: {}, body: { message: 'Not Found', }, }; } return { status: 200, headers: {}, body: { sha: 'abcdefabcdefabcdefabcdefabcdefabcdefabcd', }, }; };
expect(await preflightPublication({ repository: { owner: 'Aquaticat', name: 'issues-api', url: 'https://github.com/Aquaticat/issues-api', }, resolvedHead: 'abcdefabcdefabcdefabcdefabcdefabcdefabcd', api, },),).toStrictEqual({ needsTriageLabel: false, sourceLink: { repository: 'Aquaticat/issues-api', commit: 'abcdefabcdefabcdefabcdefabcdefabcdefabcd', }, },); expect(endpoints,).toStrictEqual([ 'repos/Aquaticat/issues-api/labels/needs-triage', 'repos/Aquaticat/issues-api/commits/abcdefabcdefabcdefabcdefabcdefabcdefabcd', ],); }, },), ],},);