Skip to content

Commit 6fa7ae9

Browse files
authored
Merge pull request #516 from unlayer/claude/fix-codecov-patch-coverage
Exclude React-version selection glue from coverage (fix codecov/patch on master)
2 parents 3a9fff2 + 7ce7093 commit 6fa7ae9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/EmailEditor.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,18 @@ const useCounterEditorId = (): string =>
2929
// mismatch that otherwise leaves the editor mounting against a stale server id
3030
// (blank editor) under SSR/Next.js. The implementation is picked once at module
3131
// load (stable for the app's lifetime), so the same hook runs on every render.
32+
//
33+
// v8 ignore: this is React-version selection glue. The two arms are covered by
34+
// separate suites (useId by the React 18/19 tests, the counter by the React
35+
// 16/17 smoke suite) but never within a single coverage run, so the untaken
36+
// arm always reads as a partial branch.
37+
/* v8 ignore start */
3238
const useGeneratedEditorId: () => string =
3339
typeof React.useId === 'function'
3440
? // Strip ':' so the id is a valid CSS selector for unlayer.createEditor.
3541
() => `editor-${React.useId().replace(/:/g, '')}`
3642
: useCounterEditorId;
43+
/* v8 ignore stop */
3744

3845
function EmailEditorInner<
3946
TDisplayMode extends DisplayMode | undefined = 'email',

0 commit comments

Comments
 (0)