Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Test] Fix console error in search_service.test.ts (#595)
Run unit test suite search_service.test.ts has a console error: ``` UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'aggs' of undefined ``` This is caused by a missing promise result check in the setup fun in search_service.ts. If the promise result is empty (or null/undefined), then any properties of the empty result is undefined. In our case, `aggs` in `if (value.search.aggs.shardDelay.enabled)` is undefined. In this PR, we fixed this issue by adding a value check in setup fun. Issues resolved: #594 Signed-off-by: Anan Zhuang <[email protected]>
- Loading branch information