invertase/react-native-firebase-starter

[help-wanted] Add tests example

Open

#21 ouverte le 13 avr. 2018

Voir sur GitHub
 (2 commentaires) (6 réactions) (0 assignés)JavaScript (346 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (1 174 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

After following the getting started instructions, running npm test results in an error:

 FAIL  ./App.test.js
  ● Test suite failed to run

    RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects `Podfile` and have run `pod install`.

     See http://invertase.link/ios for the ios setup guide.

       9 | } from 'react-native'
      10 |
    > 11 | import firebase from 'react-native-firebase'
      12 |
      13 | export default class App extends React.Component {
      14 |   constructor () {
      Error: RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects `Podfile` and have run `pod install`.

This has already been reported in the react-native-firebase repo and it appears this is expected behavior - according to that thread RNFirebase needs to be mocked out for the tests to work.

Assuming that's all correct, I would propose adding a basic mock for RNFirebase to this starter project and enabling it by default.

Guide contributeur