mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-30 19:09:13 +01:00
30 lines
710 B
JavaScript
30 lines
710 B
JavaScript
import 'regenerator-runtime/runtime';
|
|
import '@testing-library/jest-dom/extend-expect';
|
|
import { server } from './server.js';
|
|
|
|
Object.defineProperty(window, 'matchMedia', {
|
|
writable: true,
|
|
value: (query) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addEventListener: jest.fn(),
|
|
removeEventListener: jest.fn(),
|
|
dispatchEvent: jest.fn(),
|
|
}),
|
|
});
|
|
|
|
jest.mock('../src/env');
|
|
|
|
// Establish API mocking before all tests.
|
|
beforeAll(() => server.listen());
|
|
|
|
// Reset any request handlers that we may add during the tests,
|
|
// so they don't affect other tests.
|
|
afterEach(() => {
|
|
server.resetHandlers();
|
|
});
|
|
|
|
// Clean up after the tests are finished.
|
|
afterAll(() => server.close());
|