| 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) => { |