Summary: Don't print console.debug logs during unit tests These diffs together reduce the amounts of logs printed during unit tests from 6000 to 3000. Reviewed By: passy Differential Revision: D32557595 fbshipit-source-id: eef2b742157f16638d9ce270cf8b3d8d0f4e2952
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
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
|
|
*/
|
|
|
|
// jest-setup-after will run after Jest has been initialized, so that it can be adapted.
|
|
import {cleanup} from '@testing-library/react';
|
|
|
|
const test = global.test;
|
|
if (!test) {
|
|
throw new Error('Failed jest test object');
|
|
}
|
|
/**
|
|
* This test will not be executed on Github / SandCastle,
|
|
* since, for example, it relies on precise timer reliability
|
|
*/
|
|
test.local = function local() {
|
|
const fn = process.env.SANDCASTLE || process.env.CI ? test.skip : test;
|
|
// eslint-disable-next-line
|
|
return fn.apply(null, arguments);
|
|
};
|
|
|
|
/**
|
|
* This test will only run on non-windows machines
|
|
*/
|
|
test.unix = function local() {
|
|
const fn = process.platform === 'win32' ? test.skip : test;
|
|
// eslint-disable-next-line
|
|
return fn.apply(null, arguments);
|
|
};
|
|
|
|
afterEach(cleanup);
|
|
|
|
console.debug = function () {
|
|
// Intentional noop, we don't want debug statements in Jest runs
|
|
};
|