mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: reduces strict null errors to 824 (#22744)
* Chore: reduces strict null errors with 100+ * Chore: lowers the build error number
This commit is contained in:
@@ -917,7 +917,12 @@ describe('ElasticResponse', () => {
|
||||
expect(r._id).toEqual(response.responses[0].hits.hits[i]._id);
|
||||
expect(r._type).toEqual(response.responses[0].hits.hits[i]._type);
|
||||
expect(r._index).toEqual(response.responses[0].hits.hits[i]._index);
|
||||
expect(r._source).toEqual(flatten(response.responses[0].hits.hits[i]._source, null));
|
||||
expect(r._source).toEqual(
|
||||
flatten(
|
||||
response.responses[0].hits.hits[i]._source,
|
||||
(null as unknown) as { delimiter?: any; maxDepth?: any; safe?: any }
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Make a map from the histogram results
|
||||
@@ -938,14 +943,14 @@ describe('ElasticResponse', () => {
|
||||
const result = new ElasticResponse(targets, response).getLogs(undefined, 'level');
|
||||
const fieldCache = new FieldCache(result.data[0]);
|
||||
const field = fieldCache.getFieldByName('level');
|
||||
expect(field.values.toArray()).toEqual(['debug', 'error']);
|
||||
expect(field?.values.toArray()).toEqual(['debug', 'error']);
|
||||
});
|
||||
|
||||
it('should re map levels field to new field', () => {
|
||||
const result = new ElasticResponse(targets, response).getLogs(undefined, 'fields.lvl');
|
||||
const fieldCache = new FieldCache(result.data[0]);
|
||||
const field = fieldCache.getFieldByName('level');
|
||||
expect(field.values.toArray()).toEqual(['debug', 'info']);
|
||||
expect(field?.values.toArray()).toEqual(['debug', 'info']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user