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

@@ -262,10 +262,10 @@ describe('InfluxQuery', () => {
);
query.addGroupBy('tag(host)');
expect(query.target.groupBy.length).toBe(3);
expect(query.target.groupBy[1].type).toBe('tag');
expect(query.target.groupBy[1].params[0]).toBe('host');
expect(query.target.groupBy[2].type).toBe('fill');
expect(query.target.groupBy?.length).toBe(3);
expect(query.target.groupBy![1].type).toBe('tag');
expect(query.target.groupBy![1].params![0]).toBe('host');
expect(query.target.groupBy![2].type).toBe('fill');
});
it('should add tag last if no fill', () => {
@@ -280,8 +280,8 @@ describe('InfluxQuery', () => {
);
query.addGroupBy('tag(host)');
expect(query.target.groupBy.length).toBe(1);
expect(query.target.groupBy[0].type).toBe('tag');
expect(query.target.groupBy?.length).toBe(1);
expect(query.target.groupBy![0].type).toBe('tag');
});
});
@@ -298,8 +298,8 @@ describe('InfluxQuery', () => {
);
query.addSelectPart(query.selectModels[0], 'mean');
expect(query.target.select[0].length).toBe(2);
expect(query.target.select[0][1].type).toBe('mean');
expect(query.target.select![0].length).toBe(2);
expect(query.target.select![0][1].type).toBe('mean');
});
it('should replace sum by mean', () => {
@@ -314,8 +314,8 @@ describe('InfluxQuery', () => {
);
query.addSelectPart(query.selectModels[0], 'sum');
expect(query.target.select[0].length).toBe(2);
expect(query.target.select[0][1].type).toBe('sum');
expect(query.target.select![0].length).toBe(2);
expect(query.target.select![0][1].type).toBe('sum');
});
it('should add math before alias', () => {
@@ -330,8 +330,8 @@ describe('InfluxQuery', () => {
);
query.addSelectPart(query.selectModels[0], 'math');
expect(query.target.select[0].length).toBe(4);
expect(query.target.select[0][2].type).toBe('math');
expect(query.target.select![0].length).toBe(4);
expect(query.target.select![0][2].type).toBe('math');
});
it('should add math last', () => {
@@ -346,8 +346,8 @@ describe('InfluxQuery', () => {
);
query.addSelectPart(query.selectModels[0], 'math');
expect(query.target.select[0].length).toBe(3);
expect(query.target.select[0][2].type).toBe('math');
expect(query.target.select![0].length).toBe(3);
expect(query.target.select![0][2].type).toBe('math');
});
it('should replace math', () => {
@@ -362,8 +362,8 @@ describe('InfluxQuery', () => {
);
query.addSelectPart(query.selectModels[0], 'math');
expect(query.target.select[0].length).toBe(3);
expect(query.target.select[0][2].type).toBe('math');
expect(query.target.select![0].length).toBe(3);
expect(query.target.select![0][2].type).toBe('math');
});
it('should add math when one only query part', () => {
@@ -378,8 +378,8 @@ describe('InfluxQuery', () => {
);
query.addSelectPart(query.selectModels[0], 'math');
expect(query.target.select[0].length).toBe(2);
expect(query.target.select[0][1].type).toBe('math');
expect(query.target.select![0].length).toBe(2);
expect(query.target.select![0][1].type).toBe('math');
});
describe('when render adhoc filters', () => {