I try to make a simple test
import 'react-native';
import React from 'react';
import App from '../src/App';
import {render} from '@testing-library/react-native';
// Silence the warning https://github.com/facebook/react-native/issues/11094#issuecomment-263240420
jest.mock('react-native/Libraries/Animated/src/NativeAnimatedHelper');
it('renders correctly', async () => {
const {findByText, findAllByText} = render(<App />);
const homeText = await findByText(/home/i);
expect(homeText).toBeTruthy();
});
But when it run I get the below msg
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
In a web enviroment, I saw that could be resolve stopping some service like mongoose.close() for example, but here in RN idk what it is the thing that should stop to resolve that message. Could you help me please?
Aucun commentaire:
Enregistrer un commentaire