Skip to content

Commit

Permalink
Verify columns in helper return object
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshMock committed Apr 24, 2024
1 parent 6dab754 commit d587b5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/unit/helpers/esql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test('ES|QL helper', t => {
})

const result = await client.helpers.esql({ query: 'FROM sample_data' }).toRecords<MyDoc>()
const { records } = result
const { records, columns } = result
t.equal(records.length, 2)
t.ok(records[0])
t.same(records[0], {
Expand All @@ -75,6 +75,12 @@ test('ES|QL helper', t => {
event_duration: 3450233,
message: 'Connected to 10.1.0.3'
})
t.same(columns, [
{ name: '@timestamp', type: 'date' },
{ name: 'client_ip', type: 'ip' },
{ name: 'event_duration', type: 'long' },
{ name: 'message', type: 'keyword' }
])
t.end()
})

Expand Down

0 comments on commit d587b5a

Please sign in to comment.