storj/web/multinode/jest.setup.ts
Egon Elbre 9d3c886f35 web/multinode: update dependencies
Change-Id: If575d8d9b481476203cc08c80d95d49273d45c29
2022-04-06 14:48:21 +00:00

14 lines
528 B
TypeScript

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
import { GlobalWithFetchMock } from 'jest-fetch-mock';
const customGlobal = (global as unknown) as
(GlobalWithFetchMock & { console: Record<any,unknown> });
customGlobal.fetch = require('jest-fetch-mock');
customGlobal.fetchMock = customGlobal.fetch;
// Disallow warnings and errors from console.
customGlobal.console.warn = (message) => { throw new Error(message); };
customGlobal.console.error = (message) => { throw new Error(message); };