MCPcopy
hub / github.com/facebook/react / coerceGateConditionToFunction

Function coerceGateConditionToFunction

scripts/jest/setupTests.js:219–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217 };
218
219 const coerceGateConditionToFunction = gateFnOrString => {
220 return typeof gateFnOrString === 'string'
221 ? // `gate('foo')` is treated as equivalent to `gate(flags => flags.foo)`
222 flags => flags[gateFnOrString]
223 : // Assume this is already a function
224 gateFnOrString;
225 };
226
227 const gatedErrorMessage = 'Gated test was expected to fail, but it passed.';
228 global._test_gate = (gateFnOrString, testName, callback, timeoutMS) => {

Callers 1

setupTests.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected