Files
flipper/static/globalTestSetup.js
Pascal Hartig 08e74e617b Polyfill fetch() for tests
Summary: Per title. Required as Scribe is now being used for device tests.

Reviewed By: jknoxville, danielbuechele

Differential Revision: D13971892

fbshipit-source-id: 2df36d44d4e45a579cc9cca0d4cad9105ba8a383
2019-02-06 16:33:24 -08:00

17 lines
464 B
JavaScript

/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
const defaultConsoleError = console.error;
console.error = function(message) {
defaultConsoleError(
'console.error used in a test. This will be an error in the near future.',
);
defaultConsoleError.apply(console, arguments);
};
global.fetch = require('jest-fetch-mock');