From 4138b6244455509d2a1bd673f399c8411c447f07 Mon Sep 17 00:00:00 2001 From: Maciej Jastrzebski Date: Wed, 16 Nov 2022 10:17:02 +0100 Subject: [PATCH] chore: fix lint --- src/to-have-text-content.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/to-have-text-content.ts b/src/to-have-text-content.ts index 6a7e51b..a8da0c5 100644 --- a/src/to-have-text-content.ts +++ b/src/to-have-text-content.ts @@ -9,7 +9,7 @@ function collectNormalizedText(element: ReactTestInstance) { function collectChildrenText(element: ReactTestInstance | string): string[] { if (typeof element === 'string') return [element]; - if (!element || !element.children) return []; + if (!element?.children) return []; const result: string[] = []; element.children.forEach((child) => {