Skip to content

Commit c0358b2

Browse files
authored
Amir/FEQ-214/Enable react query dev tool in coverall (deriv-com#9495)
* chore: enable react query dev tool * chore: add mock for copy-anything package
1 parent c552a36 commit c0358b2

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

__mocks__/globals.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Mock copy-anything module which is causing issues with jest in coveralls
2+
jest.mock('copy-anything', () => ({
3+
copy: jest.fn(),
4+
}));

packages/api/src/APIProvider.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import React, { PropsWithChildren } from 'react';
22
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3-
// import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
3+
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
44

55
const queryClient = new QueryClient();
66

77
const APIProvider = ({ children }: PropsWithChildren<unknown>) => (
88
<QueryClientProvider client={queryClient}>
99
{children}
10-
{/*Temporary disabled due to the problem on codecov, You can uncomment to use in development environment, DO NOT COMMIT THIS UNCOMMENTED*/}
11-
{/*<ReactQueryDevtools />*/}
10+
<ReactQueryDevtools />
1211
</QueryClientProvider>
1312
);
1413

setupTests.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@
77
/** provides a set of custom jest matchers that you can use to extend jest.
88
* These will make your tests more declarative, clear to read and to maintain. */
99
import '@testing-library/jest-dom';
10-
import '@testing-library/jest-dom/extend-expect'
10+
import '@testing-library/jest-dom/extend-expect';
1111

1212
/**
1313
* jest-extended aims to add additional matchers to Jest's default ones making it easy to test everything raised_hands
1414
*/
1515
import 'jest-extended';
1616

17-
1817
/**
1918
* Chain Jest matchers together to write easier matchers and reduce code.
20-
*/
19+
*/
2120
import 'jest-chain';
21+
22+
/**
23+
* Setup Global mocks
24+
*/
25+
import './__mocks__/globals';

0 commit comments

Comments
 (0)