[APM] fixing annotations unit test (#138302) (#138453)

(cherry picked from commit ab937a3716)
This commit is contained in:
Cauê Marcondes 2022-08-09 16:42:17 -04:00 committed by GitHub
parent 716d0f3c9f
commit 7eb3e9e0ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -217,21 +217,17 @@ describe('getServiceAnnotations', () => {
.mockImplementation(
() =>
new Promise((resolve, reject) => {
setTimeout(() => {
reject(
new WrappedElasticsearchClientError(
new errors.RequestAbortedError('foo')
)
);
}, 20);
reject(
new WrappedElasticsearchClientError(
new errors.RequestAbortedError('foo')
)
);
})
);
jest.spyOn(GetStoredAnnotations, 'getStoredAnnotations').mockImplementation(
async () =>
new Promise((resolve) => {
setTimeout(() => {
resolve(storedAnnotations);
}, 10);
resolve(storedAnnotations);
})
);