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:
Hugo Häggmark
2020-03-12 10:22:33 +01:00
committed by GitHub
parent 4fecf5a7a6
commit b51e28bc15
35 changed files with 202 additions and 160 deletions

View File

@@ -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']);
});
});
});