Skip to content

Commit edfa10a

Browse files
committed
fix eslint issues
1 parent bd0864a commit edfa10a

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = {extends: ['@commitlint/config-conventional']}
1+
module.exports = {extends: ['@commitlint/config-conventional']};

test/lib/hierarchy-operations/hierarchy-operations.spec.js

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const reports_by_freetext = {
3737
};
3838

3939
const reports_by_subject = {
40-
// eslint-disable-next-line quotes
40+
// eslint-disable-next-line quotes,max-len
4141
map: "function(doc) {\n if (doc.type === 'data_record' && doc.form) {\n var emitField = function(obj, field) {\n if (obj[field]) {\n emit(obj[field], doc.reported_date);\n }\n };\n\n emitField(doc, 'patient_id');\n emitField(doc, 'place_id');\n emitField(doc, 'case_id');\n\n if (doc.fields) {\n emitField(doc.fields, 'patient_id');\n emitField(doc.fields, 'place_id');\n emitField(doc.fields, 'case_id');\n emitField(doc.fields, 'patient_uuid');\n emitField(doc.fields, 'place_uuid');\n }\n }\n}"
4242
};
4343

@@ -178,6 +178,7 @@ describe('hierarchy-operations', () => {
178178
}
179179
}, {
180180
body: {
181+
// eslint-disable-next-line max-len
181182
hits: [{id:'report_1',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_1',_rev:'1-2b8fdb6d5e5068efcf1ee44b23d030a3'}}]
182183
}
183184
});
@@ -300,6 +301,7 @@ describe('hierarchy-operations', () => {
300301
}
301302
}, {
302303
body: {
304+
// eslint-disable-next-line max-len
303305
hits: [{id:'report_1',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_1',_rev:'1-2b8fdb6d5e5068efcf1ee44b23d030a3'}}]
304306
}
305307
});
@@ -346,9 +348,13 @@ describe('hierarchy-operations', () => {
346348
});
347349

348350
expect(pouchDb.query.callCount).to.equal(1);
349-
expect(pouchDb.query.args).to.deep.equal([
350-
['medic/contacts_by_depth', { key: ['health_center_1'], include_docs: true, group_level: undefined, skip: undefined, limit: undefined }],
351-
]);
351+
expect(pouchDb.query.args).to.deep.equal([['medic/contacts_by_depth', {
352+
key: ['health_center_1'],
353+
include_docs: true,
354+
group_level: undefined,
355+
skip: undefined,
356+
limit: undefined
357+
}],]);
352358
});
353359

354360
it('move district_1 from root in CHT version 4.15.0', async () => {
@@ -412,6 +418,7 @@ describe('hierarchy-operations', () => {
412418
}
413419
}, {
414420
body: {
421+
// eslint-disable-next-line max-len
415422
hits: [{id:'report_1',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_1',_rev:'1-2b8fdb6d5e5068efcf1ee44b23d030a3'}}]
416423
}
417424
});
@@ -526,6 +533,7 @@ describe('hierarchy-operations', () => {
526533
}
527534
}, {
528535
body: {
536+
// eslint-disable-next-line max-len
529537
hits: [{id:'report_1',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_1',_rev:'1-2b8fdb6d5e5068efcf1ee44b23d030a3'}}]
530538
}
531539
});
@@ -630,6 +638,7 @@ describe('hierarchy-operations', () => {
630638
}
631639
}, {
632640
body: {
641+
// eslint-disable-next-line max-len
633642
hits: [{id:'report_focal',fields:{patient_uuid:'focal'},doc:{form:'foo',type:'data_record',contact:{_id:'focal',parent:{_id:'county'}},fields:{patient_uuid:'focal'},_id:'report_focal',_rev:'1-3c114cf77eede46c9f65b5b696bdaa07'}}]
634643
}
635644
});
@@ -800,6 +809,7 @@ describe('hierarchy-operations', () => {
800809
}
801810
}, {
802811
body: {
812+
// eslint-disable-next-line max-len
803813
hits: [{id:'report_1',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_1',_rev:'1-2b8fdb6d5e5068efcf1ee44b23d030a3'}}]
804814
}
805815
});
@@ -1098,6 +1108,7 @@ describe('hierarchy-operations', () => {
10981108
}, {
10991109
body: {
11001110
hits: [
1111+
// eslint-disable-next-line max-len
11011112
{id:'report_1',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_1',_rev:'1-2b8fdb6d5e5068efcf1ee44b23d030a3'}}
11021113
]
11031114
}
@@ -1108,6 +1119,7 @@ describe('hierarchy-operations', () => {
11081119
}, {
11091120
body: {
11101121
hits: [
1122+
// eslint-disable-next-line max-len
11111123
{id:'report_2',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_2',_rev:'1-3cc001d7d9c9a306920e0caeb54709d4'}}
11121124
]
11131125
}
@@ -1118,6 +1130,7 @@ describe('hierarchy-operations', () => {
11181130
}, {
11191131
body: {
11201132
hits: [
1133+
// eslint-disable-next-line max-len
11211134
{id:'report_3',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_3',_rev:'1-3b7b94f966bcc262a48063efdf1ebf84'}}
11221135
]
11231136
}
@@ -1128,6 +1141,7 @@ describe('hierarchy-operations', () => {
11281141
}, {
11291142
body: {
11301143
hits: [
1144+
// eslint-disable-next-line max-len
11311145
{id:'report_4',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_4',_rev:'1-622a96629997c0e89d73af7cfb360056'}}
11321146
]
11331147
}
@@ -1200,9 +1214,13 @@ describe('hierarchy-operations', () => {
12001214
});
12011215

12021216
expect(pouchDb.query.callCount).to.deep.equal(1);
1203-
expect(pouchDb.query.args).to.deep.equal([
1204-
['medic/contacts_by_depth', { key: ['health_center_1'], include_docs: true, group_level: undefined, skip: undefined, limit: undefined }],
1205-
]);
1217+
expect(pouchDb.query.args).to.deep.equal([['medic/contacts_by_depth', {
1218+
key: ['health_center_1'],
1219+
include_docs: true,
1220+
group_level: undefined,
1221+
skip: undefined,
1222+
limit: undefined
1223+
}],]);
12061224
});
12071225

12081226
it('should health_center_1 to district_1 in batches of 2 in CHT version 4.15.0', async () => {
@@ -1312,6 +1330,7 @@ describe('hierarchy-operations', () => {
13121330
}
13131331
}, {
13141332
body: {
1333+
// eslint-disable-next-line max-len
13151334
hits: [{id:'report_1',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_1',_rev:'1-2b8fdb6d5e5068efcf1ee44b23d030a3'}},{id:'report_2',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_2',_rev:'1-3cc001d7d9c9a306920e0caeb54709d4'}}]
13161335
}
13171336
}, {
@@ -1320,6 +1339,7 @@ describe('hierarchy-operations', () => {
13201339
}
13211340
}, {
13221341
body: {
1342+
// eslint-disable-next-line max-len
13231343
hits: [{id:'report_3',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_3',_rev:'1-3b7b94f966bcc262a48063efdf1ebf84'}},{id:'report_4',fields:{patient_uuid:'health_center_1_contact'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_1_contact',parent:{_id:'health_center_1',parent:{_id:'district_1'}}},fields:{patient_uuid:'health_center_1_contact'},_id:'report_4',_rev:'1-622a96629997c0e89d73af7cfb360056'}}]
13241344
}
13251345
}, {
@@ -1392,6 +1412,7 @@ describe('hierarchy-operations', () => {
13921412

13931413
expect(pouchDb.query.callCount).to.deep.equal(1);
13941414
expect(pouchDb.query.args).to.deep.equal([
1415+
// eslint-disable-next-line max-len
13951416
['medic/contacts_by_depth', { key: ['health_center_1'], include_docs: true, group_level: undefined, skip: undefined, limit: undefined }],
13961417
]);
13971418
});
@@ -1503,6 +1524,7 @@ describe('hierarchy-operations', () => {
15031524
}
15041525
}, {
15051526
body: {
1527+
// eslint-disable-next-line max-len
15061528
hits: [{id:'changing_contact',fields:{patient_uuid:'patient_2'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_2_contact',parent:{_id:'health_center_2',parent:{_id:'district_2'}}},fields:{patient_uuid:'patient_2'},_id:'changing_contact',_rev:'1-c9209b38cc343b10932c27f130175415'}},{id:'changing_subject_and_contact',fields:{patient_uuid:'district_2'},doc:{form:'foo',type:'data_record',contact:{_id:'health_center_2_contact',parent:{_id:'health_center_2',parent:{_id:'district_2'}}},fields:{patient_uuid:'district_2'},_id:'changing_subject_and_contact',_rev:'1-4c64faf5402e5c9e63060dc274448730'}}]
15071529
}
15081530
});

0 commit comments

Comments
 (0)