signoz/frontend/jest.setup.ts
Rajat Dabade 90f7ba191b
[Refactor]: Jest setup for wrapping Provider and mocking Query Ranges (#3705)
* refactor: setup wrapper for all the providers

* refactor: done with unit test configuration and service layer testing

* refactor: checking for multiple services

* refactor: updated test cases added table sort

* refactor: moved hooks mocking to test-utils

* refactor: added the search test case

* refactor: updated the handler with mocks data
2023-10-19 15:37:06 +05:30

30 lines
687 B
TypeScript

/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable object-shorthand */
/* eslint-disable func-names */
/**
* Adds custom matchers from the react testing library to all tests
*/
import '@testing-library/jest-dom';
import 'jest-styled-components';
import { server } from './src/mocks-server/server';
// Establish API mocking before all tests.
// Mock window.matchMedia
window.matchMedia =
window.matchMedia ||
function (): any {
return {
matches: false,
addListener: function () {},
removeListener: function () {},
};
};
beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());