Skip to content

Commit 71492ce

Browse files
committed
test: fix DOMAttributes event extraction
1 parent 6198688 commit 71492ce

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎tests/utils.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,14 @@ describe('utils', () => {
348348
// handlers. Scanning the whole dts would also pick up component
349349
// callbacks such as `ViewTransitionProps.onEnter`.
350350
const domAttrsBlock = dts.match(
351-
/interface DOMAttributes<T> \{[^}]*/,
351+
/interface DOMAttributes<T> \{[\s\S]*?^ {4}\}/m,
352352
)?.[0];
353353
const reactEvents = [...domAttrsBlock!.matchAll(/\bon[A-Z]\w*(?=\?:)/g)]
354354
.map(m => m[0])
355355
.filter(n => !isCapturePhase(n));
356356

357+
expect(reactEvents.length).toBeGreaterThan(0);
358+
357359
const dropped = reactEvents.filter(
358360
e => pickAttrs({ [e]: 1 }, { attr: true })[e] === undefined,
359361
);

0 commit comments

Comments
 (0)