Skip to content

Commit 404ab68

Browse files
authored
test: fix eslint errors (#400)
1 parent d054166 commit 404ab68

6 files changed

+95
-67
lines changed

test/functional/CommandCallFunctional.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('CommandCall Functional Tests', function () {
1919
connection.run((error, xmlOut) => {
2020
expect(error).to.equal(null);
2121
const parser = new XMLParser();
22-
let result = parser.parse(xmlOut);
22+
const result = parser.parse(xmlOut);
2323
expect(Object.keys(result).length).gt(0);
2424
expect(result.myscript.cmd.success).to.include('+++ success RTVJOBA USRLIBL(?) SYSLIBL(?)');
2525
done();
@@ -37,7 +37,7 @@ describe('CommandCall Functional Tests', function () {
3737
// but on error sh or qsh node will not have any inner data
3838

3939
const parser = new XMLParser();
40-
let result = parser.parse(xmlOut);
40+
const result = parser.parse(xmlOut);
4141
expect(Object.keys(result).length).gt(0);
4242
expect(result.myscript.sh).to.match(/(System\sStatus\sInformation)/);
4343
done();
@@ -56,7 +56,7 @@ describe('CommandCall Functional Tests', function () {
5656
// but on error sh or qsh node will not have any inner data
5757

5858
const parser = new XMLParser();
59-
let result = parser.parse(xmlOut);
59+
const result = parser.parse(xmlOut);
6060
expect(Object.keys(result).length).gt(0);
6161
const { version } = result.myscript.pgm;
6262
const match = version.match(/\d\.\d\.\d/);

test/functional/ProgramCallFunctional.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('ProgramCall Functional Tests', function () {
5959
expect(error).to.equal(null);
6060

6161
const parser = new XMLParser();
62-
let result = parser.parse(xmlOut);
62+
const result = parser.parse(xmlOut);
6363
expect(Object.keys(result).length).gt(0);
6464
expect(result.myscript.pgm.success).to.include('+++ success QSYS QWCRSVAL');
6565
done();
@@ -85,7 +85,7 @@ describe('ProgramCall Functional Tests', function () {
8585
connection.run((error, xmlOut) => {
8686
expect(error).to.equal(null);
8787
const parser = new XMLParser();
88-
let result = parser.parse(xmlOut);
88+
const result = parser.parse(xmlOut);
8989
expect(Object.keys(result).length).gt(0);
9090
expect(result.myscript.pgm.success).to.include('+++ success');
9191
expect(result.myscript.pgm.return.data).to.equal('my name is Gill');

test/functional/deprecated/commandsFunctional.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('iSh, iCmd, iQsh, Functional Tests', function () {
4242
connection.add(iCmd('RTVJOBA USRLIBL(?) SYSLIBL(?)'));
4343
connection.run((xmlOut) => {
4444
const parser = new XMLParser();
45-
let result = parser.parse(xmlOut);
45+
const result = parser.parse(xmlOut);
4646
expect(Object.keys(result).length).gt(0);
4747
expect(result.myscript.cmd.success).to.include('+++ success RTVJOBA USRLIBL(?) SYSLIBL(?)');
4848
done();
@@ -58,7 +58,7 @@ describe('iSh, iCmd, iQsh, Functional Tests', function () {
5858
// xs does not return success property for sh or qsh command calls
5959
// but on error sh or qsh node will not have any inner data
6060
const parser = new XMLParser();
61-
let result = parser.parse(xmlOut);
61+
const result = parser.parse(xmlOut);
6262
expect(Object.keys(result).length).gt(0);
6363
expect(result.myscript.sh).to.match(/(System\sStatus\sInformation)/);
6464
done();
@@ -75,7 +75,7 @@ describe('iSh, iCmd, iQsh, Functional Tests', function () {
7575
// xs does not return success property for sh or qsh command calls
7676
// but on error sh or qsh node will not have any inner data
7777
const parser = new XMLParser();
78-
let result = parser.parse(xmlOut);
78+
const result = parser.parse(xmlOut);
7979
expect(Object.keys(result).length).gt(0);
8080
const { version } = result.myscript.pgm;
8181
const match = version.match(/\d\.\d\.\d/);

test/functional/deprecated/iPgmFunctional.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (config.transport === 'rest') {
3131
describe('iPgm Functional Tests', function () {
3232
before(function () {
3333
printConfig();
34-
});
34+
});
3535

3636
describe('addParam', function () {
3737
it('calls QWCRSVAL program checks if it ran successfully', function (done) {
@@ -57,7 +57,7 @@ describe('iPgm Functional Tests', function () {
5757
connection.add(program);
5858
connection.run((xmlOut) => {
5959
const parser = new XMLParser();
60-
let result = parser.parse(xmlOut);
60+
const result = parser.parse(xmlOut);
6161
expect(Object.keys(result).length).gt(0);
6262
expect(result.myscript.pgm.success).to.include('+++ success QSYS QWCRSVAL');
6363
done();
@@ -79,7 +79,7 @@ describe('iPgm Functional Tests', function () {
7979
connection.add(program);
8080
connection.run((xmlOut) => {
8181
const parser = new XMLParser();
82-
let result = parser.parse(xmlOut);
82+
const result = parser.parse(xmlOut);
8383
expect(Object.keys(result).length).gt(0);
8484
expect(result.myscript.pgm.success).to.include('+++ success');
8585
expect(result.myscript.pgm.return.data).to.equal('my name is Gill');

test/functional/deprecated/iSqlFunctional.js

+42-28
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ describe('iSql Functional Tests', function () {
4646
connection.add(sql);
4747
connection.run((xmlOut) => {
4848
const parser = new XMLParser({
49-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
49+
// Added ignoreAttributes to allow fast-xml-parser to return description.
50+
ignoreAttributes: false,
5051
attributeNamePrefix: '',
5152
});
52-
let result = parser.parse(xmlOut);
53+
const result = parser.parse(xmlOut);
5354
expect(Object.keys(result).length).gt(0);
5455
const sqlNode = result.myscript.sql;
5556
expect(sqlNode.prepare.success).to.include('+++ success');
@@ -80,10 +81,11 @@ describe('iSql Functional Tests', function () {
8081
connection.add(sql);
8182
connection.run((xmlOut) => {
8283
const parser = new XMLParser({
83-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
84+
// Added ignoreAttributes to allow fast-xml-parser to return description.
85+
ignoreAttributes: false,
8486
attributeNamePrefix: '',
8587
});
86-
let result = parser.parse(xmlOut);
88+
const result = parser.parse(xmlOut);
8789
expect(Object.keys(result).length).gt(0);
8890
const sqlNode = result.myscript.sql;
8991
expect(sqlNode.query.success).to.include('+++ success');
@@ -108,10 +110,11 @@ describe('iSql Functional Tests', function () {
108110
connection.add(sql);
109111
connection.run((xmlOut) => {
110112
const parser = new XMLParser({
111-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
113+
// Added ignoreAttributes to allow fast-xml-parser to return description.
114+
ignoreAttributes: false,
112115
attributeNamePrefix: '',
113116
});
114-
let result = parser.parse(xmlOut);
117+
const result = parser.parse(xmlOut);
115118
expect(Object.keys(result).length).gt(0);
116119
const sqlNode = result.myscript.sql;
117120
expect(sqlNode.query.success).to.include('+++ success');
@@ -134,10 +137,11 @@ describe('iSql Functional Tests', function () {
134137
connection.add(sql.toXML());
135138
connection.run((xmlOut) => {
136139
const parser = new XMLParser({
137-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
140+
// Added ignoreAttributes to allow fast-xml-parser to return description.
141+
ignoreAttributes: false,
138142
attributeNamePrefix: '',
139143
});
140-
let result = parser.parse(xmlOut);
144+
const result = parser.parse(xmlOut);
141145
expect(Object.keys(result).length).gt(0);
142146
expect(result.myscript.sql.tables.success).to.include('+++ success');
143147
const { data } = result.myscript.sql.tables.row;
@@ -161,10 +165,11 @@ describe('iSql Functional Tests', function () {
161165
connection.add(sql.toXML());
162166
connection.run((xmlOut) => {
163167
const parser = new XMLParser({
164-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
168+
// Added ignoreAttributes to allow fast-xml-parser to return description.
169+
ignoreAttributes: false,
165170
attributeNamePrefix: '',
166171
});
167-
let result = parser.parse(xmlOut);
172+
const result = parser.parse(xmlOut);
168173
expect(Object.keys(result).length).gt(0);
169174
expect(result.myscript.sql.tablepriv.success).to.include('+++ success');
170175
const { data } = result.myscript.sql.tablepriv.row[0];
@@ -190,10 +195,11 @@ describe('iSql Functional Tests', function () {
190195
connection.add(sql.toXML());
191196
connection.run((xmlOut) => {
192197
const parser = new XMLParser({
193-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
198+
// Added ignoreAttributes to allow fast-xml-parser to return description.
199+
ignoreAttributes: false,
194200
attributeNamePrefix: '',
195201
});
196-
let result = parser.parse(xmlOut);
202+
const result = parser.parse(xmlOut);
197203
expect(Object.keys(result).length).gt(0);
198204
expect(result.myscript.sql.columns.success).to.include('+++ success');
199205
const { data } = result.myscript.sql.columns.row;
@@ -231,10 +237,11 @@ describe('iSql Functional Tests', function () {
231237
connection.add(sql.toXML());
232238
connection.run((xmlOut) => {
233239
const parser = new XMLParser({
234-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
240+
// Added ignoreAttributes to allow fast-xml-parser to return description.
241+
ignoreAttributes: false,
235242
attributeNamePrefix: '',
236243
});
237-
let result = parser.parse(xmlOut);
244+
const result = parser.parse(xmlOut);
238245
expect(Object.keys(result).length).gt(0);
239246
expect(result.myscript.sql.columnpriv.success).to.include('+++ success');
240247
const { data } = result.myscript.sql.columnpriv.row[0];
@@ -261,10 +268,11 @@ describe('iSql Functional Tests', function () {
261268
connection.add(sql.toXML());
262269
connection.run((xmlOut) => {
263270
const parser = new XMLParser({
264-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
271+
// Added ignoreAttributes to allow fast-xml-parser to return description.
272+
ignoreAttributes: false,
265273
attributeNamePrefix: '',
266274
});
267-
let result = parser.parse(xmlOut);
275+
const result = parser.parse(xmlOut);
268276
expect(Object.keys(result).length).gt(0);
269277
expect(result.myscript.sql.procedures.success).to.include('+++ success');
270278
const { data } = result.myscript.sql.procedures.row;
@@ -291,10 +299,11 @@ describe('iSql Functional Tests', function () {
291299
connection.add(sql.toXML());
292300
connection.run((xmlOut) => {
293301
const parser = new XMLParser({
294-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
302+
// Added ignoreAttributes to allow fast-xml-parser to return description.
303+
ignoreAttributes: false,
295304
attributeNamePrefix: '',
296305
});
297-
let result = parser.parse(xmlOut);
306+
const result = parser.parse(xmlOut);
298307
expect(Object.keys(result).length).gt(0);
299308
expect(result.myscript.sql.pcolumns.success).to.include('+++ success');
300309
const { data } = result.myscript.sql.pcolumns.row;
@@ -332,10 +341,11 @@ describe('iSql Functional Tests', function () {
332341
connection.add(sql.toXML());
333342
connection.run((xmlOut) => {
334343
const parser = new XMLParser({
335-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
344+
// Added ignoreAttributes to allow fast-xml-parser to return description.
345+
ignoreAttributes: false,
336346
attributeNamePrefix: '',
337347
});
338-
let result = parser.parse(xmlOut);
348+
const result = parser.parse(xmlOut);
339349
expect(Object.keys(result).length).gt(0);
340350
expect(result.myscript.sql.primarykeys.success).to.include('+++ success');
341351
const { data } = result.myscript.sql.primarykeys.row[0];
@@ -361,10 +371,11 @@ describe('iSql Functional Tests', function () {
361371
connection.add(sql.toXML());
362372
connection.run((xmlOut) => {
363373
const parser = new XMLParser({
364-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
374+
// Added ignoreAttributes to allow fast-xml-parser to return description.
375+
ignoreAttributes: false,
365376
attributeNamePrefix: '',
366377
});
367-
let result = parser.parse(xmlOut);
378+
const result = parser.parse(xmlOut);
368379
expect(Object.keys(result).length).gt(0);
369380
expect(result.myscript.sql.foreignkeys.success).to.include('+++ success');
370381
const { data } = result.myscript.sql.foreignkeys.row;
@@ -397,10 +408,11 @@ describe('iSql Functional Tests', function () {
397408
connection.add(sql.toXML());
398409
connection.run((xmlOut) => {
399410
const parser = new XMLParser({
400-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
411+
// Added ignoreAttributes to allow fast-xml-parser to return description.
412+
ignoreAttributes: false,
401413
attributeNamePrefix: '',
402414
});
403-
let result = parser.parse(xmlOut);
415+
const result = parser.parse(xmlOut);
404416
expect(Object.keys(result).length).gt(0);
405417
expect(result.myscript.sql.statistics.success).to.include('+++ success');
406418
const { data } = result.myscript.sql.statistics.row;
@@ -436,10 +448,11 @@ describe('iSql Functional Tests', function () {
436448
connection.debug(true);
437449
connection.run((xmlOut) => {
438450
const parser = new XMLParser({
439-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
451+
// Added ignoreAttributes to allow fast-xml-parser to return description.
452+
ignoreAttributes: false,
440453
attributeNamePrefix: '',
441454
});
442-
let result = parser.parse(xmlOut);
455+
const result = parser.parse(xmlOut);
443456
expect(Object.keys(result).length).gt(0);
444457
// TODO add more assertions
445458
expect(result).to.be.an('object');
@@ -464,10 +477,11 @@ describe('iSql Functional Tests', function () {
464477
connection.add(sql.toXML());
465478
connection.run((xmlOut) => {
466479
const parser = new XMLParser({
467-
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
480+
// Added ignoreAttributes to allow fast-xml-parser to return description.
481+
ignoreAttributes: false,
468482
attributeNamePrefix: '',
469483
});
470-
let result = parser.parse(xmlOut);
484+
const result = parser.parse(xmlOut);
471485
expect(Object.keys(result).length).gt(0);
472486
const sqlNode = result.myscript.sql;
473487
expect(sqlNode.query.success).to.include('+++ success');

0 commit comments

Comments
 (0)