github
1354 of 1531 branches covered (88.44%)
Branch coverage included in aggregate %.
113 of 1543 new or added lines in 23 files covered. (7.32%)
3 existing lines in 3 files now uncovered.5522 of 10725 relevant lines covered (51.49%)
28.35 hits per line
NEW
|
import type { SpyDevice } from '@huolala-tech/page-spy-types'; |
× |
NEW
|
import { Platform } from 'react-native'; |
× |
NEW
|
import { OS } from '@huolala-tech/page-spy-types/lib/device'; |
× |
NEW
|
|
× |
NEW
|
const osMap: Record<typeof Platform.OS, OS> = {
|
× |
NEW
|
android: 'android', |
× |
NEW
|
ios: 'ios', |
× |
NEW
|
windows: 'windows', |
× |
NEW
|
macos: 'mac', |
× |
NEW
|
web: 'unknown', // this should not happen. |
× |
NEW
|
}; |
× |
NEW
|
|
× |
NEW
|
const rnv = Platform.constants.reactNativeVersion;
|
× |
NEW
|
|
× |
NEW
|
export default class Device { |
× |
NEW
|
static info: SpyDevice.DeviceInfo = {
|
× |
NEW
|
osType: osMap[Platform.OS] || 'unknown', |
× |
NEW
|
osVersion: String(Platform.Version), |
× |
NEW
|
browserType: 'react-native', |
× |
NEW
|
browserVersion: `${rnv.major}.${rnv.minor}.${rnv.patch}${
|
× |
NEW
|
rnv.prerelease ? '-' + rnv.prerelease : '' |
× |
NEW
|
}`,
|
× |
NEW
|
framework: 'react-native', |
× |
NEW
|
isDevTools: false,
|
× |
NEW
|
}; |
× |
NEW
|
} |
× |