* @param {string} name * @return {!Function} * @throws {TypeError}
(name)
| 588 | * @throws {TypeError} |
| 589 | */ |
| 590 | function getTestHook(name) { |
| 591 | let fn = global[name] |
| 592 | let type = typeof fn |
| 593 | if (type !== 'function') { |
| 594 | throw TypeError( |
| 595 | `Expected global.${name} to be a function, but is ${type}.` + |
| 596 | ' This can happen if you try using this module when running with' + |
| 597 | ' node directly instead of using jasmine or mocha', |
| 598 | ) |
| 599 | } |
| 600 | return fn |
| 601 | } |
| 602 | |
| 603 | /** |
| 604 | * Bazel's hermetic java, from `SE_BAZEL_JAVA_LOCATION` (a file holding the `$(JAVA)` path). |