MohGovIL / hamagen-react-native

Israel's Ministry of Health's COVID-19 Exposure Prevention App
https://health.gov.il/
MIT License
508 stars 153 forks source link

tests failing with 'TypeError: _reactNativeDeviceInfo.default.getBuildNumber is not a function' #258

Open emanuelb opened 4 years ago

emanuelb commented 4 years ago

Running yarn jest

Result:

yarn run v1.22.4
$ /app/hamagen-react-native-master/node_modules/.bin/jest
 FAIL  src/services/__tests__/LocationHistoryService.test.ts
  ● Test suite failed to run

    TypeError: _reactNativeDeviceInfo.default.getBuildNumber is not a function

       7 | export const HIT_SLOP: Insets = { top: 10, bottom: 10, left: 10, right: 10 };
       8 | export const VERSION_NAME: string = DeviceInfo.getVersion();
    >  9 | export const VERSION_BUILD: string = DeviceInfo.getBuildNumber();
         |                                                 ^
      10 | export const SHOW_DOT_BY_BUILD_NUMBER: string = '96'
      11 | 
      12 | // Dimensions

      at Object.<anonymous> (src/constants/Constants.ts:9:49)
      at Object.<anonymous> (src/services/__tests__/LocationHistoryService.test.ts:9:1)

 FAIL  src/services/__tests__/Tracker.test.ts
  ● Test suite failed to run

    TypeError: _reactNativeDeviceInfo.default.getBuildNumber is not a function

       7 | export const HIT_SLOP: Insets = { top: 10, bottom: 10, left: 10, right: 10 };
       8 | export const VERSION_NAME: string = DeviceInfo.getVersion();
    >  9 | export const VERSION_BUILD: string = DeviceInfo.getBuildNumber();
         |                                                 ^
      10 | export const SHOW_DOT_BY_BUILD_NUMBER: string = '96'
      11 | 
      12 | // Dimensions

      at Object.<anonymous> (src/constants/Constants.ts:9:49)
      at Object.<anonymous> (src/actions/ExposuresActions.ts:14:1)

 FAIL  src/actions/__tests__/ExposuresActions.test.ts
  ● Test suite failed to run

    TypeError: _reactNativeDeviceInfo.default.getBuildNumber is not a function

       7 | export const HIT_SLOP: Insets = { top: 10, bottom: 10, left: 10, right: 10 };
       8 | export const VERSION_NAME: string = DeviceInfo.getVersion();
    >  9 | export const VERSION_BUILD: string = DeviceInfo.getBuildNumber();
         |                                                 ^
      10 | export const SHOW_DOT_BY_BUILD_NUMBER: string = '96'
      11 | 
      12 | // Dimensions

      at Object.<anonymous> (src/constants/Constants.ts:9:49)
      at Object.<anonymous> (src/actions/__tests__/ExposuresActions.test.ts:5:1)

 FAIL  src/services/__tests__/SampleService.test.ts
  ● Test suite failed to run

    TypeError: _reactNativeDeviceInfo.default.getBuildNumber is not a function

       7 | export const HIT_SLOP: Insets = { top: 10, bottom: 10, left: 10, right: 10 };
       8 | export const VERSION_NAME: string = DeviceInfo.getVersion();
    >  9 | export const VERSION_BUILD: string = DeviceInfo.getBuildNumber();
         |                                                 ^
      10 | export const SHOW_DOT_BY_BUILD_NUMBER: string = '96'
      11 | 
      12 | // Dimensions

      at Object.<anonymous> (src/constants/Constants.ts:9:49)
      at Object.<anonymous> (src/services/ClusteringService.ts:10:1)