Skip to content

Commit c0bc6bb

Browse files
committedSep 19, 2022
feat: disable console error in jest
1 parent 448a8ec commit c0bc6bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎packages/ra-core/src/dataProvider/useDataProvider.spec.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ describe('useDataProvider', () => {
231231
});
232232

233233
it('should call getList and show error', async () => {
234+
jest.spyOn(console, 'error').mockImplementation(() => {});
235+
234236
const getList = jest.fn(() =>
235237
Promise.resolve({ data: [{ id: 1, title: 'foo' }] })
236238
);
@@ -240,6 +242,7 @@ describe('useDataProvider', () => {
240242
<UseGetList />
241243
</CoreAdminContext>
242244
);
245+
243246
expect(queryByTestId('loading')).not.toBeNull();
244247
await act(async () => {
245248
await new Promise(resolve => setTimeout(resolve));

0 commit comments

Comments
 (0)
Please sign in to comment.