Skip to content

Commit 908633b

Browse files
humaidk2Abbondanzo
andauthored
Update packages/react-native/Libraries/Image/__tests__/Image-test.js
Simplify null check to satisfy flow conditions Co-authored-by: Peter Abbondanzo <peter@abbondanzo.com>
1 parent c5a3fe4 commit 908633b

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

packages/react-native/Libraries/Image/__tests__/Image-test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,7 @@ describe('Image', () => {
352352
);
353353

354354
const tree = instance.toJSON();
355-
if (tree == null || Array.isArray(tree)) {
356-
throw new Error('Expected a single rendered element');
357-
}
358-
expect(tree.props.headers).toEqual({Authorization: 'Bearer xyz'});
355+
expect(tree?.props.headers).toEqual({Authorization: 'Bearer xyz'});
359356
});
360357

361358
it('forwards source.headers as a top-level prop on Android for array sources', async () => {

0 commit comments

Comments
 (0)