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 { 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
|
} |
× |