Summary: We were losing the first argument of every console.error call during tests. This happens to be useful stuff, like react telling you how to do better testing etc, and explains the weird looking error output from the ConfigField tests. Reviewed By: passy Differential Revision: D17931532 fbshipit-source-id: cfeb834a4646ef68ac55f81a269bcfef7a25ea31
20 lines
470 B
JavaScript
20 lines
470 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* 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(...args) {
|
|
defaultConsoleError(
|
|
'console.error used in a test. This will be an error in the near future.',
|
|
);
|
|
defaultConsoleError(...args);
|
|
};
|
|
|
|
global.fetch = require('jest-fetch-mock');
|