Skip to content

Commit

Permalink
test: fix eslint errors (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
sravani1510 authored Sep 4, 2024
1 parent d054166 commit 404ab68
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 67 deletions.
6 changes: 3 additions & 3 deletions test/functional/CommandCallFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('CommandCall Functional Tests', function () {
connection.run((error, xmlOut) => {
expect(error).to.equal(null);
const parser = new XMLParser();
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.cmd.success).to.include('+++ success RTVJOBA USRLIBL(?) SYSLIBL(?)');
done();
Expand All @@ -37,7 +37,7 @@ describe('CommandCall Functional Tests', function () {
// but on error sh or qsh node will not have any inner data

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

const parser = new XMLParser();
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
const { version } = result.myscript.pgm;
const match = version.match(/\d\.\d\.\d/);
Expand Down
4 changes: 2 additions & 2 deletions test/functional/ProgramCallFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('ProgramCall Functional Tests', function () {
expect(error).to.equal(null);

const parser = new XMLParser();
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.pgm.success).to.include('+++ success QSYS QWCRSVAL');
done();
Expand All @@ -85,7 +85,7 @@ describe('ProgramCall Functional Tests', function () {
connection.run((error, xmlOut) => {
expect(error).to.equal(null);
const parser = new XMLParser();
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.pgm.success).to.include('+++ success');
expect(result.myscript.pgm.return.data).to.equal('my name is Gill');
Expand Down
6 changes: 3 additions & 3 deletions test/functional/deprecated/commandsFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('iSh, iCmd, iQsh, Functional Tests', function () {
connection.add(iCmd('RTVJOBA USRLIBL(?) SYSLIBL(?)'));
connection.run((xmlOut) => {
const parser = new XMLParser();
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.cmd.success).to.include('+++ success RTVJOBA USRLIBL(?) SYSLIBL(?)');
done();
Expand All @@ -58,7 +58,7 @@ describe('iSh, iCmd, iQsh, Functional Tests', function () {
// xs does not return success property for sh or qsh command calls
// but on error sh or qsh node will not have any inner data
const parser = new XMLParser();
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sh).to.match(/(System\sStatus\sInformation)/);
done();
Expand All @@ -75,7 +75,7 @@ describe('iSh, iCmd, iQsh, Functional Tests', function () {
// xs does not return success property for sh or qsh command calls
// but on error sh or qsh node will not have any inner data
const parser = new XMLParser();
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
const { version } = result.myscript.pgm;
const match = version.match(/\d\.\d\.\d/);
Expand Down
6 changes: 3 additions & 3 deletions test/functional/deprecated/iPgmFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (config.transport === 'rest') {
describe('iPgm Functional Tests', function () {
before(function () {
printConfig();
});
});

describe('addParam', function () {
it('calls QWCRSVAL program checks if it ran successfully', function (done) {
Expand All @@ -57,7 +57,7 @@ describe('iPgm Functional Tests', function () {
connection.add(program);
connection.run((xmlOut) => {
const parser = new XMLParser();
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.pgm.success).to.include('+++ success QSYS QWCRSVAL');
done();
Expand All @@ -79,7 +79,7 @@ describe('iPgm Functional Tests', function () {
connection.add(program);
connection.run((xmlOut) => {
const parser = new XMLParser();
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.pgm.success).to.include('+++ success');
expect(result.myscript.pgm.return.data).to.equal('my name is Gill');
Expand Down
70 changes: 42 additions & 28 deletions test/functional/deprecated/iSqlFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql);
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
const sqlNode = result.myscript.sql;
expect(sqlNode.prepare.success).to.include('+++ success');
Expand Down Expand Up @@ -80,10 +81,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql);
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
const sqlNode = result.myscript.sql;
expect(sqlNode.query.success).to.include('+++ success');
Expand All @@ -108,10 +110,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql);
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
const sqlNode = result.myscript.sql;
expect(sqlNode.query.success).to.include('+++ success');
Expand All @@ -134,10 +137,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sql.tables.success).to.include('+++ success');
const { data } = result.myscript.sql.tables.row;
Expand All @@ -161,10 +165,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sql.tablepriv.success).to.include('+++ success');
const { data } = result.myscript.sql.tablepriv.row[0];
Expand All @@ -190,10 +195,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sql.columns.success).to.include('+++ success');
const { data } = result.myscript.sql.columns.row;
Expand Down Expand Up @@ -231,10 +237,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sql.columnpriv.success).to.include('+++ success');
const { data } = result.myscript.sql.columnpriv.row[0];
Expand All @@ -261,10 +268,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sql.procedures.success).to.include('+++ success');
const { data } = result.myscript.sql.procedures.row;
Expand All @@ -291,10 +299,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sql.pcolumns.success).to.include('+++ success');
const { data } = result.myscript.sql.pcolumns.row;
Expand Down Expand Up @@ -332,10 +341,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sql.primarykeys.success).to.include('+++ success');
const { data } = result.myscript.sql.primarykeys.row[0];
Expand All @@ -361,10 +371,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sql.foreignkeys.success).to.include('+++ success');
const { data } = result.myscript.sql.foreignkeys.row;
Expand Down Expand Up @@ -397,10 +408,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
expect(result.myscript.sql.statistics.success).to.include('+++ success');
const { data } = result.myscript.sql.statistics.row;
Expand Down Expand Up @@ -436,10 +448,11 @@ describe('iSql Functional Tests', function () {
connection.debug(true);
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
// TODO add more assertions
expect(result).to.be.an('object');
Expand All @@ -464,10 +477,11 @@ describe('iSql Functional Tests', function () {
connection.add(sql.toXML());
connection.run((xmlOut) => {
const parser = new XMLParser({
ignoreAttributes: false, // Added ignoreAttributes to allow fast-xml-parser to return description.
// Added ignoreAttributes to allow fast-xml-parser to return description.
ignoreAttributes: false,
attributeNamePrefix: '',
});
let result = parser.parse(xmlOut);
const result = parser.parse(xmlOut);
expect(Object.keys(result).length).gt(0);
const sqlNode = result.myscript.sql;
expect(sqlNode.query.success).to.include('+++ success');
Expand Down
Loading

0 comments on commit 404ab68

Please sign in to comment.