mirror of
https://github.com/hectorqin/reader.git
synced 2026-11-11 05:20:54 +08:00
Merge branch 'fix/ci-list-return-timing'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
b58d2bc554
2 files changed
+6
-2
No files matched your search
@@ -62,7 +62,9 @@ function mount(entry: string) {
|
||||
));
|
||||
}
|
||||
async function settle(done: () => boolean) {
|
||||
for (let i = 0; i < 50 && !done(); i++) await act(async () => { await new Promise(resolve => setTimeout(resolve, 10)); });
|
||||
// Up to 4s rather than 50 polls: a slow CI runner's first render alone can take over half a second.
|
||||
const deadline = Date.now() + 4000;
|
||||
while (!done() && Date.now() < deadline) await act(async () => { await new Promise(resolve => setTimeout(resolve, 10)); });
|
||||
expect(done()).toBe(true);
|
||||
}
|
||||
const prefer = (patch: Partial<MediaPreferences>) => saveMediaPreferences(scope, { density: 'compact', showContinue: true, showLibraryName: true, ...patch });
|
||||
|
||||
@@ -50,8 +50,10 @@ function mount(initial: string) {
|
||||
return router;
|
||||
}
|
||||
|
||||
/** Polls until `done` holds, for up to 4s: a slow CI runner's first render alone can take over half a second. */
|
||||
async function settle(done: () => boolean) {
|
||||
for (let i = 0; i < 50 && !done(); i++) await act(async () => { await new Promise(resolve => setTimeout(resolve, 10)); });
|
||||
const deadline = Date.now() + 4000;
|
||||
while (!done() && Date.now() < deadline) await act(async () => { await new Promise(resolve => setTimeout(resolve, 10)); });
|
||||
expect(done()).toBe(true);
|
||||
}
|
||||
const screen = () => root.querySelector<HTMLElement>('.media-screen')!;
|
||||
|
||||
Reference in new issue
Block a user