mercredi 28 mars 2018

React Native - Jest testing with firebase

I am a newbie in Firebase. I have read that it is good to unit test as you go. So this is what I have been trying to do lately. I currently have a problem when trying to test render on a class that uses Firebase. This is the following code I have been trying to fix:

import 'react-native';
import React from 'react';
import MainTab from '../../components/MainTab';
import Enzyme from 'enzyme';

import renderer from 'react-test-renderer';

it('renders correctly', () => {
  const tree = renderer.create(
    <MainTab/>
    ).toJSON();
  expect(tree).toMatchSnapshot();
});

However, I am getting the following error on the test when trying to obtain the current user's id from firebase: enter image description here

Has anyone stumbled into this error before? P.S. Don't go hard on me if this is something really vacuous, just trying to learn.

Aucun commentaire:

Enregistrer un commentaire