github
1353 of 1531 branches covered (88.37%)
Branch coverage included in aggregate %.
83 of 1570 new or added lines in 22 files covered. (5.29%)
5401 of 10928 relevant lines covered (49.42%)
27.59 hits per line
NEW
|
import type { ErrorHandlerCallback } from 'react-native'; |
× |
NEW
|
import '@testing-library/jest-native/extend-expect'; |
× |
NEW
|
|
× |
NEW
|
Object.defineProperty(globalThis, 'name', { |
× |
NEW
|
value: 'React Native 单元测试', |
× |
NEW
|
}); |
× |
NEW
|
|
× |
NEW
|
Object.defineProperty(globalThis, 'ErrorUtils', { |
× |
NEW
|
value: function () {
|
× |
NEW
|
let handler: ErrorHandlerCallback | null = null; |
× |
NEW
|
return {
|
× |
NEW
|
triggerError(err: Error | string) {
|
× |
NEW
|
handler?.(err); |
× |
NEW
|
}, |
× |
NEW
|
setGlobalHandler(cb: ErrorHandlerCallback) { |
× |
NEW
|
handler = cb; |
× |
NEW
|
}, |
× |
NEW
|
getGlobalHandler() { |
× |
NEW
|
return handler;
|
× |
NEW
|
}, |
× |
NEW
|
}; |
× |
NEW
|
}, |
× |
NEW
|
}); |
× |