Skip to content

Commit 900a6cc

Browse files
committed
Merge commit '8f2bcf356' into rn-viewconfig-error-improvement
2 parents 9942896 + 8f2bcf3 commit 900a6cc

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

packages/react-native-renderer/src/__tests__/ReactNativeError-test.internal.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ describe('ReactNativeError', () => {
3333
});
3434

3535
it('should throw error if null component registration getter is used', () => {
36-
let error;
37-
try {
38-
createReactNativeComponentClass('View', null);
39-
} catch (e) {
40-
error = e;
41-
}
42-
43-
expect(error.toString()).toBe('Invariant Violation: View config getter callback must be a function: View (received null)');
36+
expect(() => {
37+
try {
38+
createReactNativeComponentClass('View', null);
39+
} catch (e) {
40+
throw new Error(e.toString());
41+
}
42+
}).toThrow('Invariant Violation: View config getter callback must be a function: View (received null)');
4443
});
4544

4645
it('should be able to extract a component stack from a native view', () => {

0 commit comments

Comments
 (0)