Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar committed Dec 22, 2021
1 parent 282d3ac commit d50c2e9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ const getWaterfallDuration = (waterfallItems: IWaterfallItem[]) =>

const getWaterfallItems = (items: TraceAPIResponse['traceDocs']) =>
items.map((item) => {
// @ts-expect-error 'processor' does not exist on type 'Profile'
const docType: 'span' | 'transaction' = item.processor.event;
switch (docType) {
case 'span':
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/server/routes/traces/get_trace_items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function getTraceItems(
{ _score: { order: 'asc' as const } },
{ [TRANSACTION_DURATION]: { order: 'desc' as const } },
{ [SPAN_DURATION]: { order: 'desc' as const } },
],
] as Sort,
track_total_hits: true,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
`);
expectSnapshot(
response.body.traceDocs.map((doc) =>
// @ts-expect-error Property 'processor' does not exist on type 'Profile'.
doc.processor.event === 'transaction'
? // @ts-expect-error
`${doc.transaction.name} (transaction)`
: // @ts-expect-error
`${doc.span.name} (span)`
'span' in doc ? `${doc.span.name} (span)` : `${doc.transaction.name} (transaction)`
)
).toMatchInline(`
Array [
Expand Down

0 comments on commit d50c2e9

Please sign in to comment.