forked from Github/frigate
test(web): api/index.jsx
This commit is contained in:
committed by
Blake Blackshear
parent
53288d361c
commit
6d133ef724
@@ -12,3 +12,11 @@ Object.defineProperty(window, 'matchMedia', {
|
||||
dispatchEvent: jest.fn(),
|
||||
}),
|
||||
});
|
||||
|
||||
window.fetch = () => Promise.resolve();
|
||||
|
||||
beforeEach(() => {
|
||||
jest.spyOn(window, 'fetch').mockImplementation(async (url, opts = {}) => {
|
||||
throw new Error(`Unexpected fetch to ${url}, ${JSON.stringify(opts)}`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user