* @param {string} name * @return {!Function} * @throws {TypeError}
(name)
| 614 | * @throws {TypeError} |
| 615 | */ |
| 616 | function getTestHook(name) { |
| 617 | let fn = global[name] |
| 618 | let type = typeof fn |
| 619 | if (type !== 'function') { |
| 620 | throw TypeError( |
| 621 | `Expected global.${name} to be a function, but is ${type}.` + |
| 622 | ' This can happen if you try using this module when running with' + |
| 623 | ' node directly instead of using jasmine or mocha', |
| 624 | ) |
| 625 | } |
| 626 | return fn |
| 627 | } |
| 628 | |
| 629 | /** |
| 630 | * Bazel's hermetic java, from `SE_BAZEL_JAVA_LOCATION` (a file holding the `$(JAVA)` path). |