2020-04-16 15:18:35 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
import { GlobalWithFetchMock } from 'jest-fetch-mock';
|
|
|
|
|
2022-04-06 16:51:04 +01:00
|
|
|
const customGlobal = (global as unknown) as
|
|
|
|
(GlobalWithFetchMock & { console: Record<any,unknown> });
|
2020-04-16 15:18:35 +01:00
|
|
|
|
|
|
|
customGlobal.fetch = require('jest-fetch-mock');
|
|
|
|
customGlobal.fetchMock = customGlobal.fetch;
|
2021-08-31 13:36:31 +01:00
|
|
|
|
|
|
|
// Disallow warnings and errors from console.
|
|
|
|
customGlobal.console.warn = (message) => { throw new Error(message); };
|
|
|
|
customGlobal.console.error = (message) => { throw new Error(message); };
|