• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yiming-liao / logry / 19128187210

06 Nov 2025 07:30AM UTC coverage: 95.764% (+0.2%) from 95.603%
19128187210

push

github

yiming-liao
chore(release): bump version to 2.0.1

428 of 489 branches covered (87.53%)

Branch coverage included in aggregate %.

3913 of 4044 relevant lines covered (96.76%)

3.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

67.35
/src/core/handler-manager/utils/setup-flush-strategy.ts
1
import type {
1✔
2
  CancelFlushStrategy,
1✔
3
  OnErrorCallback,
1✔
4
  FlushStrategy,
1✔
5
} from "@/core/handler-manager/handler-manager-config-types";
1✔
6

1✔
7
type SetupFlushStrategyOptions = {
1✔
8
  flushStrategy: FlushStrategy;
1✔
9
  flush: () => Promise<void>;
1✔
10
  onError?: OnErrorCallback;
1✔
11
};
1✔
12

1✔
13
/**
1✔
14
 * Sets up a flush strategy and returns a cancel function (if any).
1✔
15
 */
1✔
16
export function setupFlushStrategy({
2✔
17
  flushStrategy,
2✔
18
  flush,
2✔
19
  onError,
2✔
20
}: SetupFlushStrategyOptions): CancelFlushStrategy | undefined {
2✔
21
  try {
2✔
22
    const cancel = flushStrategy(async () => {
2✔
23
      try {
1✔
24
        await flush();
1✔
25
      } catch (error) {
1!
26
        onError?.({
×
27
          error,
×
28
          id: "flush strategy",
×
29
          isFlushError: true,
×
30
        });
×
31
      }
×
32
    });
2✔
33

2✔
34
    if (typeof cancel === "function") {
2✔
35
      return cancel;
2✔
36
    }
2✔
37
  } catch (error) {
2!
38
    onError?.({
×
39
      error,
×
40
      id: "flush strategy setup",
×
41
      isFlushError: false,
×
42
    });
×
43
  }
×
44
  return undefined;
×
45
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc