console_warn.js

import isJestTest from '../data/is-jest-test';

/**
 * @module consoleWarn
 * @description Logs console warnings if console is available, and we aren't running Jest.
 *
 * @since 1.0.0
 *
 * @param {string} message The message to log as a warning.
 *
 * @requires isJestTest
 *
 * @return {void}
 *
 * @example
 * import { consoleWarn } from "@gravityforms/utils";
 *
 * function Example() {
 *     consoleWarn( 'Warning from example' );
 * }
 *
 */
export default function consoleWarn( message = '' ) {
	if ( window.console && ! isJestTest() ) {
		console.warn( message );
	}
}