mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
test(release): type patched history options before runtime setup
This commit is contained in:
1 parent
df5c48ffda
commit
18451e4797
1 file changed
+21
-3
@@ -373,12 +373,30 @@ it.each([false, true])(
|
|||||||
const full = [];
|
const full = [];
|
||||||
for await (const commit of fixture.github.mergeCommitIterator("main"))
|
for await (const commit of fixture.github.mergeCommitIterator("main"))
|
||||||
full.push(commit);
|
full.push(commit);
|
||||||
const omitted = [];
|
expect(fixture.pages.length).toBeGreaterThan(0);
|
||||||
for await (const commit of fixture.github.mergeCommitIterator("main", {
|
expect(fixture.pages.every((page) => page.includeFiles === true)).toBe(
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
const fullPageCount = fixture.pages.length;
|
||||||
|
// The runtime patch adds this option after source checks read upstream types.
|
||||||
|
const options = {
|
||||||
includeFiles: false,
|
includeFiles: false,
|
||||||
backfillFiles: true,
|
backfillFiles: true,
|
||||||
}))
|
} satisfies NonNullable<
|
||||||
|
Parameters<typeof fixture.github.mergeCommitIterator>[1]
|
||||||
|
> & { includeFiles: boolean };
|
||||||
|
const omitted = [];
|
||||||
|
for await (const commit of fixture.github.mergeCommitIterator(
|
||||||
|
"main",
|
||||||
|
options,
|
||||||
|
))
|
||||||
omitted.push(commit);
|
omitted.push(commit);
|
||||||
|
expect(fixture.pages.length).toBeGreaterThan(fullPageCount);
|
||||||
|
expect(
|
||||||
|
fixture.pages
|
||||||
|
.slice(fullPageCount)
|
||||||
|
.every((page) => page.includeFiles === false),
|
||||||
|
).toBe(true);
|
||||||
expect(full[0]?.pullRequest?.number).toBe(rebased ? 7 : 42);
|
expect(full[0]?.pullRequest?.number).toBe(rebased ? 7 : 42);
|
||||||
expect(omitted).toEqual(
|
expect(omitted).toEqual(
|
||||||
full.map(({ files: _files, pullRequest, ...commit }) => ({
|
full.map(({ files: _files, pullRequest, ...commit }) => ({
|
||||||
|
|||||||
Reference in new issue
Block a user