diff --git a/.eslintrc.js b/.eslintrc.js index 3cc9c629..6c58a645 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -27,7 +27,6 @@ module.exports = { 'prefer-arrow-callback': 'off', // The following rules cause problems for our existing tests, so they are disabled for now: - 'mocha/no-mocha-arrows': 'off', 'mocha/no-skipped-tests': 'off', 'mocha/no-hooks-for-single-case': 'off', 'mocha/no-identical-title': 'off', diff --git a/test/functional/CommandCallFunctional.js b/test/functional/CommandCallFunctional.js index 0b977157..0a19d3fb 100644 --- a/test/functional/CommandCallFunctional.js +++ b/test/functional/CommandCallFunctional.js @@ -21,13 +21,13 @@ const { CommandCall, Connection } = require('../../lib/itoolkit'); const { config, printConfig } = require('./config'); -describe('CommandCall Functional Tests', () => { - before(() => { +describe('CommandCall Functional Tests', function () { + before(function () { printConfig(); }); - describe('CL command tests', () => { - it('calls CL command', (done) => { + describe('CL command tests', function () { + it('calls CL command', function (done) { const connection = new Connection(config); connection.add(new CommandCall({ command: 'RTVJOBA USRLIBL(?) SYSLIBL(?)', type: 'cl' })); connection.run((error, xmlOut) => { @@ -41,8 +41,8 @@ describe('CommandCall Functional Tests', () => { }); }); - describe('SH command tests', () => { - it('calls PASE shell command', (done) => { + describe('SH command tests', function () { + it('calls PASE shell command', function (done) { const connection = new Connection(config); connection.add(new CommandCall({ command: 'system -i wrksyssts', type: 'sh' })); connection.run((error, xmlOut) => { @@ -58,8 +58,8 @@ describe('CommandCall Functional Tests', () => { }); }); - describe('QSH command tests', () => { - it('calls QSH command', (done) => { + describe('QSH command tests', function () { + it('calls QSH command', function (done) { const connection = new Connection(config); connection.add(new CommandCall({ command: 'system wrksyssts', type: 'qsh' })); connection.run((error, xmlOut) => { diff --git a/test/functional/ProgramCallFunctional.js b/test/functional/ProgramCallFunctional.js index a35fa156..77f4b7e4 100644 --- a/test/functional/ProgramCallFunctional.js +++ b/test/functional/ProgramCallFunctional.js @@ -15,20 +15,19 @@ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - const { expect } = require('chai'); const { parseString } = require('xml2js'); const { ProgramCall, Connection } = require('../../lib/itoolkit'); const { config, printConfig } = require('./config'); -describe('ProgramCall Functional Tests', () => { - before(() => { +describe('ProgramCall Functional Tests', function () { + before(function () { printConfig(); }); - describe('Test ProgramCall()', () => { - it('calls QWCRSVAL program checks if it ran successfully', (done) => { + describe('Test ProgramCall()', function () { + it('calls QWCRSVAL program checks if it ran successfully', function (done) { const connection = new Connection(config); const program = new ProgramCall('QWCRSVAL', { lib: 'QSYS' }); @@ -82,10 +81,10 @@ describe('ProgramCall Functional Tests', () => { }); }); - describe.skip('Test ProgramCall()', () => { + describe.skip('Test ProgramCall()', function () { // ZZSRV6 program requires XMLSERVICE built with tests // Skip for now, we need to add before hook to check ZZSRV6 is available - it.skip('Should be successful with addReturn arbitrary attribute specified', (done) => { + it.skip('Should be successful with addReturn arbitrary attribute specified', function (done) { const connection = new Connection(config); const program = new ProgramCall('ZZSRV6', { lib: 'XMLSERVICE', func: 'ZZVARY4' }); diff --git a/test/functional/deprecated/commandsFunctional.js b/test/functional/deprecated/commandsFunctional.js index 403ec00b..36e8815d 100644 --- a/test/functional/deprecated/commandsFunctional.js +++ b/test/functional/deprecated/commandsFunctional.js @@ -17,7 +17,6 @@ /* eslint-disable new-cap */ - const { expect } = require('chai'); const { parseString } = require('xml2js'); const { @@ -45,13 +44,13 @@ if (config.transport === 'rest') { }; } -describe('iSh, iCmd, iQsh, Functional Tests', () => { - before(() => { +describe('iSh, iCmd, iQsh, Functional Tests', function () { + before(function () { printConfig(); }); - describe('iCmd()', () => { - it('calls CL command', (done) => { + describe('iCmd()', function () { + it('calls CL command', function (done) { const connection = new iConn(database, username, password, restOptions); connection.add(iCmd('RTVJOBA USRLIBL(?) SYSLIBL(?)')); connection.run((xmlOut) => { @@ -64,8 +63,8 @@ describe('iSh, iCmd, iQsh, Functional Tests', () => { }); }); - describe('iSh()', () => { - it('calls PASE shell command', (done) => { + describe('iSh()', function () { + it('calls PASE shell command', function (done) { const connection = new iConn(database, username, password, restOptions); connection.add(iSh('system -i wrksyssts')); connection.run((xmlOut) => { @@ -80,8 +79,8 @@ describe('iSh, iCmd, iQsh, Functional Tests', () => { }); }); - describe('iQsh()', () => { - it('calls QSH command', (done) => { + describe('iQsh()', function () { + it('calls QSH command', function (done) { const connection = new iConn(database, username, password, restOptions); connection.add(iQsh('system wrksyssts')); connection.run((xmlOut) => { diff --git a/test/functional/deprecated/iDataQueueFunctional.js b/test/functional/deprecated/iDataQueueFunctional.js index f1ca768a..eb10a070 100644 --- a/test/functional/deprecated/iDataQueueFunctional.js +++ b/test/functional/deprecated/iDataQueueFunctional.js @@ -44,8 +44,8 @@ if (config.transport === 'rest') { const lib = 'NODETKTEST'; const dqName = 'TESTQ'; -describe('iDataQueue Functional Tests', () => { - before('check if data queue exists for tests', (done) => { +describe('iDataQueue Functional Tests', function () { + before('check if data queue exists for tests', function (done) { printConfig(); checkObjectExists(config, dqName, '*DTAQ', (error) => { if (error) { throw error; } @@ -53,8 +53,8 @@ describe('iDataQueue Functional Tests', () => { }); }); - describe('constructor', () => { - it('creates and returns an instance of iDataQueue', () => { + describe('constructor', function () { + it('creates and returns an instance of iDataQueue', function () { const connection = new iConn(database, config.user, password); const dq = new iDataQueue(connection); @@ -62,8 +62,8 @@ describe('iDataQueue Functional Tests', () => { }); }); - describe('sendToDataQueue', () => { - it('sends data to specified DQ', (done) => { + describe('sendToDataQueue', function () { + it('sends data to specified DQ', function (done) { const connection = new iConn(database, username, password, restOptions); const dq = new iDataQueue(connection); @@ -75,8 +75,8 @@ describe('iDataQueue Functional Tests', () => { }); }); - describe('receiveFromDataQueue', () => { - it('receives data from specfied DQ', (done) => { + describe('receiveFromDataQueue', function () { + it('receives data from specfied DQ', function (done) { const connection = new iConn(database, username, password, restOptions); const dq = new iDataQueue(connection); @@ -88,8 +88,8 @@ describe('iDataQueue Functional Tests', () => { }); }); - describe('clearDataQueue', () => { - it('clears the specifed DQ', (done) => { + describe('clearDataQueue', function () { + it('clears the specifed DQ', function (done) { const connection = new iConn(database, username, password, restOptions); const dq = new iDataQueue(connection); diff --git a/test/functional/deprecated/iNetworkFunctional.js b/test/functional/deprecated/iNetworkFunctional.js index e24a6ba0..42884b1d 100644 --- a/test/functional/deprecated/iNetworkFunctional.js +++ b/test/functional/deprecated/iNetworkFunctional.js @@ -41,13 +41,13 @@ if (config.transport === 'rest') { }; } -describe('iNetwork Functional Tests', () => { - before(() => { +describe('iNetwork Functional Tests', function () { + before(function () { printConfig(); }); - describe('constructor', () => { - it('creates and returns an instance of iNetwork', () => { + describe('constructor', function () { + it('creates and returns an instance of iNetwork', function () { const connection = new iConn(database, config.user, password); const net = new iNetwork(connection); @@ -56,8 +56,8 @@ describe('iNetwork Functional Tests', () => { }); }); - describe('getTCPIPAttr', () => { - it('retrieves TCP/IP Attributes', (done) => { + describe('getTCPIPAttr', function () { + it('retrieves TCP/IP Attributes', function (done) { const connection = new iConn(database, username, password, restOptions); const net = new iNetwork(connection); @@ -98,8 +98,8 @@ describe('iNetwork Functional Tests', () => { }); }); - describe('getNetInterfaceData', () => { - it('retrieves IPv4 network interface info', (done) => { + describe('getNetInterfaceData', function () { + it('retrieves IPv4 network interface info', function (done) { const connection = new iConn(database, username, password, restOptions); const net = new iNetwork(connection); diff --git a/test/functional/deprecated/iObjFunctional.js b/test/functional/deprecated/iObjFunctional.js index 6dfccb51..b3c538d2 100644 --- a/test/functional/deprecated/iObjFunctional.js +++ b/test/functional/deprecated/iObjFunctional.js @@ -41,13 +41,13 @@ if (config.transport === 'rest') { }; } -describe('iObj Functional Tests', () => { - before(() => { +describe('iObj Functional Tests', function () { + before(function () { printConfig(); }); - describe('constructor', () => { - it('creates and returns an instance of iObj', () => { + describe('constructor', function () { + it('creates and returns an instance of iObj', function () { const connection = new iConn(database, config.user, password); const obj = new iObj(connection); @@ -56,8 +56,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('retrUsrAuth', () => { - it(`returns uses's authority for an object using ${config.transport} tranport`, (done) => { + describe('retrUsrAuth', function () { + it(`returns uses's authority for an object using ${config.transport} tranport`, function (done) { const connection = new iConn(database, username, password, restOptions); const obj = new iObj(connection); @@ -100,8 +100,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('rtrCmdInfo', () => { - it('returns command info', (done) => { + describe('rtrCmdInfo', function () { + it('returns command info', function (done) { const connection = new iConn(database, username, password, restOptions); const obj = new iObj(connection); @@ -152,8 +152,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('retrPgmInfo', () => { - it('returns program info', (done) => { + describe('retrPgmInfo', function () { + it('returns program info', function (done) { const connection = new iConn(database, username, password, restOptions); const obj = new iObj(connection); @@ -226,8 +226,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('retrSrvPgmInfo', () => { - it('returns service program info', (done) => { + describe('retrSrvPgmInfo', function () { + it('returns service program info', function (done) { const connection = new iConn(database, username, password, restOptions); const obj = new iObj(connection); @@ -281,8 +281,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('retrUserInfo', () => { - it('returns specified user profile info', (done) => { + describe('retrUserInfo', function () { + it('returns specified user profile info', function (done) { const connection = new iConn(database, username, password, restOptions); const obj = new iObj(connection); @@ -307,8 +307,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('retrUsrAuthToObj', () => { - it(`retrieves info for users who are authorized to an object using ${config.transport} transpsort`, (done) => { + describe('retrUsrAuthToObj', function () { + it(`retrieves info for users who are authorized to an object using ${config.transport} transpsort`, function (done) { const connection = new iConn(database, username, password, restOptions); const obj = new iObj(connection); @@ -334,8 +334,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('addToLibraryList', () => { - it('appends lib to user\'s lib list', (done) => { + describe('addToLibraryList', function () { + it('appends lib to user\'s lib list', function (done) { const connection = new iConn(database, username, password, restOptions); const obj = new iObj(connection); diff --git a/test/functional/deprecated/iPgmFunctional.js b/test/functional/deprecated/iPgmFunctional.js index eb40a6c3..70ece28b 100644 --- a/test/functional/deprecated/iPgmFunctional.js +++ b/test/functional/deprecated/iPgmFunctional.js @@ -42,13 +42,13 @@ if (config.transport === 'rest') { }; } -describe('iPgm Functional Tests', () => { - before(() => { +describe('iPgm Functional Tests', function () { + before(function () { printConfig(); }); - describe('Test iPgm()', () => { - it('calls QWCRSVAL program checks if it ran successfully', (done) => { + describe('Test iPgm()', function () { + it('calls QWCRSVAL program checks if it ran successfully', function (done) { const connection = new iConn(database, username, password, restOptions); const program = new iPgm('QWCRSVAL', { lib: 'QSYS' }); @@ -79,10 +79,10 @@ describe('iPgm Functional Tests', () => { }); }); - describe.skip('Test iPgm()', () => { + describe.skip('Test iPgm()', function () { // ZZSRV6 program requires XMLSERVICE built with tests // Skip for now, we need to add before hook to check if ZZSRV6 is available - it.skip('Should be successful with addReturn arbitrary attribute specified using', (done) => { + it.skip('Should be successful with addReturn arbitrary attribute specified using', function (done) { const connection = new iConn(database, username, password, restOptions); const program = new iPgm('ZZSRV6', { lib: 'XMLSERVICE', func: 'ZZVARY4' }); diff --git a/test/functional/deprecated/iProdFunctional.js b/test/functional/deprecated/iProdFunctional.js index 1add9f8c..fce1bfa1 100644 --- a/test/functional/deprecated/iProdFunctional.js +++ b/test/functional/deprecated/iProdFunctional.js @@ -41,13 +41,13 @@ if (config.transport === 'rest') { }; } -describe('iProd Functional Tests', () => { - before(() => { +describe('iProd Functional Tests', function () { + before(function () { printConfig(); }); - describe('constructor', () => { - it('creates and returns an instance of iProd', () => { + describe('constructor', function () { + it('creates and returns an instance of iProd', function () { const connection = new iConn(database, config.user, password); const prod = new iProd(connection); @@ -56,8 +56,8 @@ describe('iProd Functional Tests', () => { }); }); - describe('getPTFInfo', () => { - it('returns info for specified ptf', (done) => { + describe('getPTFInfo', function () { + it('returns info for specified ptf', function (done) { const connection = new iConn(database, username, password, restOptions); const prod = new iProd(connection); @@ -98,8 +98,8 @@ describe('iProd Functional Tests', () => { }); }); - describe('getProductInfo', () => { - it('returns info for specified product', (done) => { + describe('getProductInfo', function () { + it('returns info for specified product', function (done) { const connection = new iConn(database, username, password, restOptions); const prod = new iProd(connection); @@ -129,8 +129,8 @@ describe('iProd Functional Tests', () => { // REST transport currently failing with 414 URI Too Long response code // The requested URL's length exceeds the capacity limit for this server - describe('getInstalledProducts', () => { - it('returns info for installed products', (done) => { + describe('getInstalledProducts', function () { + it('returns info for installed products', function (done) { const connection = new iConn(database, username, password, restOptions); const prod = new iProd(connection); diff --git a/test/functional/deprecated/iSqlFunctional.js b/test/functional/deprecated/iSqlFunctional.js index fcd6f350..60d8b5d0 100644 --- a/test/functional/deprecated/iSqlFunctional.js +++ b/test/functional/deprecated/iSqlFunctional.js @@ -17,7 +17,6 @@ /* eslint-disable new-cap */ - const { expect } = require('chai'); const { parseString } = require('xml2js'); const { iSql, iConn } = require('../../../lib/itoolkit'); @@ -43,13 +42,13 @@ if (config.transport === 'rest') { }; } -describe('iSql Functional Tests', () => { - before(() => { +describe('iSql Functional Tests', function () { + before(function () { printConfig(); }); - describe('prepare & execute', () => { - it('prepares & executes stored procedure then fetch results', (done) => { + describe('prepare & execute', function () { + it('prepares & executes stored procedure then fetch results', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -80,8 +79,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('addQuery & fetch', () => { - it('runs a query and fetches results', (done) => { + describe('addQuery & fetch', function () { + it('runs a query and fetches results', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -105,8 +104,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('added test to ensure issue #11 was resolved', () => { - it('should parse SQL result set empty data tags correctly', (done) => { + describe('added test to ensure issue #11 was resolved', function () { + it('should parse SQL result set empty data tags correctly', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -131,8 +130,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('tables', () => { - it('returns meta data for specified table', (done) => { + describe('tables', function () { + it('returns meta data for specified table', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -155,8 +154,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('tablePriv', () => { - it('returns privilege data for a table', (done) => { + describe('tablePriv', function () { + it('returns privilege data for a table', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -181,8 +180,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('columns', () => { - it('returns meta data for a column', (done) => { + describe('columns', function () { + it('returns meta data for a column', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -218,8 +217,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('columnPriv', () => { - it('returns privilege data for a column', (done) => { + describe('columnPriv', function () { + it('returns privilege data for a column', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -246,8 +245,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('procedures', () => { - it('returns meta data on for a procedure', (done) => { + describe('procedures', function () { + it('returns meta data on for a procedure', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -273,8 +272,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('pColumns', () => { - it('returns meta data for procedure column', (done) => { + describe('pColumns', function () { + it('returns meta data for procedure column', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -311,8 +310,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('primaryKeys', () => { - it('returns meta data for a primary key', (done) => { + describe('primaryKeys', function () { + it('returns meta data for a primary key', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -336,8 +335,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('foreignKeys', () => { - it('returns meta data for a foreign key', (done) => { + describe('foreignKeys', function () { + it('returns meta data for a foreign key', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -370,8 +369,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('statistics', () => { - it('returns stats info for table', (done) => { + describe('statistics', function () { + it('returns stats info for table', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); @@ -402,10 +401,10 @@ describe('iSql Functional Tests', () => { }); }); - describe.skip('special', () => { + describe.skip('special', function () { // TODO: find passing case // Below test fails with error code 9- argument value not valid - it.skip('returns meta data for special columns', (done) => { + it.skip('returns meta data for special columns', function (done) { // [catalog, schema, table, row | transaction |session, no | nullable] const connection = new iConn(database, username, password, restOptions); @@ -425,9 +424,9 @@ describe('iSql Functional Tests', () => { }); }); - describe.skip('rowCount', () => { + describe.skip('rowCount', function () { // Skip for now need to create a table for this test to insert to. - it.skip('returns the number of rows affected by statement', (done) => { + it.skip('returns the number of rows affected by statement', function (done) { const connection = new iConn(database, username, password, restOptions); const sql = new iSql(); diff --git a/test/functional/deprecated/iUserSpaceFunctional.js b/test/functional/deprecated/iUserSpaceFunctional.js index 040122c1..2d94c791 100644 --- a/test/functional/deprecated/iUserSpaceFunctional.js +++ b/test/functional/deprecated/iUserSpaceFunctional.js @@ -43,13 +43,13 @@ if (config.transport === 'rest') { const lib = 'NODETKTEST'; -describe('iUserSpace Functional Tests', () => { - before(() => { +describe('iUserSpace Functional Tests', function () { + before(function () { printConfig(); }); - describe('constructor', () => { - it('returns an instance of iUserSpace', () => { + describe('constructor', function () { + it('returns an instance of iUserSpace', function () { const connection = new iConn(database, config.user, password); const userSpace = new iUserSpace(connection); @@ -58,8 +58,8 @@ describe('iUserSpace Functional Tests', () => { }); }); - describe('createUserSpace', () => { - it('creates a user space', (done) => { + describe('createUserSpace', function () { + it('creates a user space', function (done) { const connection = new iConn(database, username, password, restOptions); const userSpace = new iUserSpace(connection); @@ -76,8 +76,8 @@ describe('iUserSpace Functional Tests', () => { }); }); - describe('setUserSpaceData', () => { - it('sets data within the user space', (done) => { + describe('setUserSpaceData', function () { + it('sets data within the user space', function (done) { const connection = new iConn(database, username, password, restOptions); const userSpace = new iUserSpace(connection); @@ -94,8 +94,8 @@ describe('iUserSpace Functional Tests', () => { }); }); - describe('getUserSpaceData', () => { - it('returns specified length of data', (done) => { + describe('getUserSpaceData', function () { + it('returns specified length of data', function (done) { const connection = new iConn(database, username, password, restOptions); const userSpace = new iUserSpace(connection); @@ -109,8 +109,8 @@ describe('iUserSpace Functional Tests', () => { }); }); - describe('deleteUserSpace', () => { - it('removes a user space', (done) => { + describe('deleteUserSpace', function () { + it('removes a user space', function (done) { const connection = new iConn(database, username, password, restOptions); const userSpace = new iUserSpace(connection); diff --git a/test/functional/deprecated/iWorkFunctional.js b/test/functional/deprecated/iWorkFunctional.js index ba3d60db..816f9691 100644 --- a/test/functional/deprecated/iWorkFunctional.js +++ b/test/functional/deprecated/iWorkFunctional.js @@ -42,13 +42,13 @@ if (config.transport === 'rest') { }; } -describe('iWork Functional Tests', () => { - before(() => { +describe('iWork Functional Tests', function () { + before(function () { printConfig(); }); - describe('constructor', () => { - it('creates and returns an instance of iWork', () => { + describe('constructor', function () { + it('creates and returns an instance of iWork', function () { const connection = new iConn(database, config.user, password); const work = new iWork(connection); @@ -57,8 +57,8 @@ describe('iWork Functional Tests', () => { }); }); - describe('getSysValue', () => { - it('returns the value of system variable', (done) => { + describe('getSysValue', function () { + it('returns the value of system variable', function (done) { const connection = new iConn(database, username, password, restOptions); const work = new iWork(connection); @@ -70,10 +70,10 @@ describe('iWork Functional Tests', () => { }); }); - describe('getSysStatus', () => { + describe('getSysStatus', function () { it('returns basic system status information about the signed-on users ' + 'and batch jobs', - (done) => { + function (done) { const connection = new iConn(database, username, password, restOptions); const work = new iWork(connection); @@ -100,9 +100,9 @@ describe('iWork Functional Tests', () => { }); }); - describe('getSysStatusExt', () => { + describe('getSysStatusExt', function () { it('returns more detailed system status info', - (done) => { + function (done) { const connection = new iConn(database, username, password, restOptions); const work = new iWork(connection); @@ -145,9 +145,9 @@ describe('iWork Functional Tests', () => { }); }); - describe('getJobStatus', () => { + describe('getJobStatus', function () { it('returns status of specified job', - (done) => { + function (done) { const connection = new iConn(database, username, password, restOptions); const work = new iWork(connection); @@ -161,8 +161,8 @@ describe('iWork Functional Tests', () => { }); }); - describe('getJobInfo', () => { - it('returns info on specfed job', (done) => { + describe('getJobInfo', function () { + it('returns info on specfed job', function (done) { const connection = new iConn(database, username, password, restOptions); const work = new iWork(connection); @@ -209,14 +209,14 @@ describe('iWork Functional Tests', () => { }); }); - describe('getDataArea', () => { - before('init lib, data area, and add data', (done) => { + describe('getDataArea', function () { + before('init lib, data area, and add data', function (done) { checkObjectExists(config, 'TESTDA', '*DTAARA', (error) => { if (error) { throw error; } done(); }); }); - it('returns contents of a data area', (done) => { + it('returns contents of a data area', function (done) { const connection = new iConn(database, username, password, restOptions); const work = new iWork(connection); diff --git a/test/functional/iDataQueueFunctional.js b/test/functional/iDataQueueFunctional.js index b50dc217..3ac0cf84 100644 --- a/test/functional/iDataQueueFunctional.js +++ b/test/functional/iDataQueueFunctional.js @@ -24,11 +24,11 @@ const { checkObjectExists } = require('./checkObjectExists'); const lib = 'NODETKTEST'; -describe('DataQueue Functional Tests', () => { +describe('DataQueue Functional Tests', function () { const dqName = 'TESTQ'; const dqName2 = 'TESTQ2'; - before('check if data queue exists for tests', (done) => { + before('check if data queue exists for tests', function (done) { printConfig(); checkObjectExists(config, dqName, '*DTAQ', (error) => { if (error) { throw error; } @@ -39,8 +39,8 @@ describe('DataQueue Functional Tests', () => { }); }); }); - describe('sendToDataQueue', () => { - it('sends data to specified DQ', (done) => { + describe('sendToDataQueue', function () { + it('sends data to specified DQ', function (done) { const connection = new Connection(config); const dq = new iDataQueue(connection); @@ -53,8 +53,8 @@ describe('DataQueue Functional Tests', () => { }); }); - describe('receiveFromDataQueue', () => { - it('receives data from specfied DQ', (done) => { + describe('receiveFromDataQueue', function () { + it('receives data from specfied DQ', function (done) { const connection = new Connection(config); const dq = new iDataQueue(connection); @@ -67,8 +67,8 @@ describe('DataQueue Functional Tests', () => { }); }); - describe('clearDataQueue', () => { - it('clears the specifed DQ', (done) => { + describe('clearDataQueue', function () { + it('clears the specifed DQ', function (done) { const connection = new Connection(config); const dq = new iDataQueue(connection); diff --git a/test/functional/iNetworkFunctional.js b/test/functional/iNetworkFunctional.js index 55657e7d..70a7aed5 100644 --- a/test/functional/iNetworkFunctional.js +++ b/test/functional/iNetworkFunctional.js @@ -22,13 +22,13 @@ const { Connection, iNetwork } = require('../../lib/itoolkit'); const { config, printConfig } = require('./config'); -describe('iNetwork Functional Tests', () => { - before(() => { +describe('iNetwork Functional Tests', function () { + before(function () { printConfig(); }); - describe('getTCPIPAttr', () => { - it('retrieves TCP/IP Attributes', (done) => { + describe('getTCPIPAttr', function () { + it('retrieves TCP/IP Attributes', function (done) { const connection = new Connection(config); const net = new iNetwork(connection); @@ -70,8 +70,8 @@ describe('iNetwork Functional Tests', () => { }); }); - describe('getNetInterfaceData', () => { - it('retrieves IPv4 network interface info', (done) => { + describe('getNetInterfaceData', function () { + it('retrieves IPv4 network interface info', function (done) { const connection = new Connection(config); const net = new iNetwork(connection); diff --git a/test/functional/iObjFunctional.js b/test/functional/iObjFunctional.js index bf6b8ae7..ef48ccee 100644 --- a/test/functional/iObjFunctional.js +++ b/test/functional/iObjFunctional.js @@ -21,13 +21,13 @@ const { expect } = require('chai'); const { Connection, iObj } = require('../../lib/itoolkit'); const { config, printConfig } = require('./config'); -describe('iObj Functional Tests', () => { - before(() => { +describe('iObj Functional Tests', function () { + before(function () { printConfig(); }); - describe('retrUsrAuth', () => { - it('returns uses\'s authority for an object ', (done) => { + describe('retrUsrAuth', function () { + it('returns uses\'s authority for an object ', function (done) { const connection = new Connection(config); const obj = new iObj(connection); @@ -71,8 +71,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('rtrCmdInfo', () => { - it('returns command info', (done) => { + describe('rtrCmdInfo', function () { + it('returns command info', function (done) { const connection = new Connection(config); const obj = new iObj(connection); @@ -124,8 +124,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('retrPgmInfo', () => { - it('returns program info', (done) => { + describe('retrPgmInfo', function () { + it('returns program info', function (done) { const connection = new Connection(config); const obj = new iObj(connection); @@ -199,8 +199,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('retrSrvPgmInfo', () => { - it('returns service program info', (done) => { + describe('retrSrvPgmInfo', function () { + it('returns service program info', function (done) { const connection = new Connection(config); const obj = new iObj(connection); @@ -255,8 +255,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('retrUserInfo', () => { - it('returns specified user profile info', (done) => { + describe('retrUserInfo', function () { + it('returns specified user profile info', function (done) { const connection = new Connection(config); const obj = new iObj(connection); @@ -282,8 +282,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('retrUsrAuthToObj', () => { - it(`retrieves info for users who are authorized to an object using ${config.transport} transpsort`, (done) => { + describe('retrUsrAuthToObj', function () { + it(`retrieves info for users who are authorized to an object using ${config.transport} transpsort`, function (done) { const connection = new Connection(config); const obj = new iObj(connection); @@ -310,8 +310,8 @@ describe('iObj Functional Tests', () => { }); }); - describe('addToLibraryList', () => { - it('appends lib to user\'s lib list', (done) => { + describe('addToLibraryList', function () { + it('appends lib to user\'s lib list', function (done) { const connection = new Connection(config); const obj = new iObj(connection); diff --git a/test/functional/iProdFunctional.js b/test/functional/iProdFunctional.js index 853e2703..f9d0a94a 100644 --- a/test/functional/iProdFunctional.js +++ b/test/functional/iProdFunctional.js @@ -21,13 +21,13 @@ const { expect } = require('chai'); const { Connection, iProd } = require('../../lib/itoolkit'); const { config, printConfig } = require('./config'); -describe('iProd Functional Tests', () => { - before(() => { +describe('iProd Functional Tests', function () { + before(function () { printConfig(); }); - describe('getPTFInfo', () => { - it('returns info for specified ptf', (done) => { + describe('getPTFInfo', function () { + it('returns info for specified ptf', function (done) { const connection = new Connection(config); const prod = new iProd(connection); @@ -69,8 +69,8 @@ describe('iProd Functional Tests', () => { }); }); - describe('getProductInfo', () => { - it('returns info for specified product', (done) => { + describe('getProductInfo', function () { + it('returns info for specified product', function (done) { const connection = new Connection(config); const prod = new iProd(connection); @@ -101,9 +101,9 @@ describe('iProd Functional Tests', () => { // REST transport currently failing with 414 URI Too Long response code // The requested URL's length exceeds the capacity limit for this server - describe('getInstalledProducts', () => { + describe('getInstalledProducts', function () { // eslint-disable-next-line func-names - it('returns info for installed products', (done) => { + it('returns info for installed products', function (done) { const connection = new Connection(config); const prod = new iProd(connection); diff --git a/test/functional/iSqlFunctional.js b/test/functional/iSqlFunctional.js index c442a75d..d2debda0 100644 --- a/test/functional/iSqlFunctional.js +++ b/test/functional/iSqlFunctional.js @@ -22,13 +22,13 @@ const { parseString } = require('xml2js'); const { iSql, Connection } = require('../../lib/itoolkit'); const { config, printConfig } = require('./config'); -describe('iSql Functional Tests', () => { - before(() => { +describe('iSql Functional Tests', function () { + before(function () { printConfig(); }); - describe('prepare & execute', () => { - it('prepares & executes stored procedure then fetch results', (done) => { + describe('prepare & execute', function () { + it('prepares & executes stored procedure then fetch results', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -61,8 +61,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('addQuery & fetch', () => { - it('runs a query and fetches results', (done) => { + describe('addQuery & fetch', function () { + it('runs a query and fetches results', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -87,8 +87,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('added test to ensure issue #11 was resolved', () => { - it('should parse SQL result set empty data tags correctly', (done) => { + describe('added test to ensure issue #11 was resolved', function () { + it('should parse SQL result set empty data tags correctly', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -114,8 +114,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('tables', () => { - it('returns meta data for specified table', (done) => { + describe('tables', function () { + it('returns meta data for specified table', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -139,8 +139,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('tablePriv', () => { - it('returns privilege data for a table', (done) => { + describe('tablePriv', function () { + it('returns privilege data for a table', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -166,8 +166,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('columns', () => { - it('returns meta data for a column', (done) => { + describe('columns', function () { + it('returns meta data for a column', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -204,8 +204,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('columnPriv', () => { - it('returns privilege data for a column', (done) => { + describe('columnPriv', function () { + it('returns privilege data for a column', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -233,8 +233,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('procedures', () => { - it('returns meta data on for a procedure', (done) => { + describe('procedures', function () { + it('returns meta data on for a procedure', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -261,8 +261,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('pColumns', () => { - it('returns meta data for procedure column', (done) => { + describe('pColumns', function () { + it('returns meta data for procedure column', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -300,8 +300,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('primaryKeys', () => { - it('returns meta data for a primary key', (done) => { + describe('primaryKeys', function () { + it('returns meta data for a primary key', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -326,8 +326,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('foreignKeys', () => { - it('returns meta data for a foreign key', (done) => { + describe('foreignKeys', function () { + it('returns meta data for a foreign key', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -361,8 +361,8 @@ describe('iSql Functional Tests', () => { }); }); - describe('statistics', () => { - it('returns stats info for table', (done) => { + describe('statistics', function () { + it('returns stats info for table', function (done) { const connection = new Connection(config); const sql = new iSql(); @@ -394,10 +394,10 @@ describe('iSql Functional Tests', () => { }); }); - describe.skip('special', () => { + describe.skip('special', function () { // TODO: find passing case // Below test fails with error code 9- argument value not valid - it.skip('returns meta data for special columns', (done) => { + it.skip('returns meta data for special columns', function (done) { // [catalog, schema, table, row | transaction |session, no | nullable] const connection = new Connection(config); @@ -418,9 +418,9 @@ describe('iSql Functional Tests', () => { }); }); - describe.skip('rowCount', () => { + describe.skip('rowCount', function () { // Skip for now need to create a table for this test to insert to. - it.skip('returns the number of rows affected by statement', (done) => { + it.skip('returns the number of rows affected by statement', function (done) { const connection = new Connection(config); const sql = new iSql(); diff --git a/test/functional/iUserSpaceFunctional.js b/test/functional/iUserSpaceFunctional.js index 37fc7787..72f0bd91 100644 --- a/test/functional/iUserSpaceFunctional.js +++ b/test/functional/iUserSpaceFunctional.js @@ -37,15 +37,15 @@ function generateRandomName() { return name.toUpperCase(); } -describe('UserSpace Functional Tests', () => { - before(() => { +describe('UserSpace Functional Tests', function () { + before(function () { printConfig(); }); let userSpaceName; - describe('createUserSpace', () => { - it('creates a user space', (done) => { + describe('createUserSpace', function () { + it('creates a user space', function (done) { const connection = new Connection(config); const userSpace = new iUserSpace(connection); @@ -64,8 +64,8 @@ describe('UserSpace Functional Tests', () => { }); }); - describe('setUserSpaceData', () => { - it('sets data within the user space', (done) => { + describe('setUserSpaceData', function () { + it('sets data within the user space', function (done) { if (!userSpaceName) { this.skip(); } @@ -85,8 +85,8 @@ describe('UserSpace Functional Tests', () => { }); }); - describe('getUserSpaceData', () => { - it('returns specified length of data', (done) => { + describe('getUserSpaceData', function () { + it('returns specified length of data', function (done) { if (!userSpaceName) { this.skip(); } @@ -103,8 +103,8 @@ describe('UserSpace Functional Tests', () => { }); }); - describe('deleteUserSpace', () => { - it('removes a user space', (done) => { + describe('deleteUserSpace', function () { + it('removes a user space', function (done) { if (!userSpaceName) { this.skip(); } diff --git a/test/functional/iWorkFunctional.js b/test/functional/iWorkFunctional.js index 9fbcb74b..52b1d755 100644 --- a/test/functional/iWorkFunctional.js +++ b/test/functional/iWorkFunctional.js @@ -22,13 +22,13 @@ const { Connection, iWork } = require('../../lib/itoolkit'); const { config, printConfig } = require('./config'); const { checkObjectExists } = require('./checkObjectExists'); -describe('iWork Functional Tests', () => { - before(() => { +describe('iWork Functional Tests', function () { + before(function () { printConfig(); }); - describe('getSysValue', () => { - it('returns the value of system variable', (done) => { + describe('getSysValue', function () { + it('returns the value of system variable', function (done) { const connection = new Connection(config); const work = new iWork(connection); @@ -40,7 +40,7 @@ describe('iWork Functional Tests', () => { }); }); - it('returns an error when the specified system value is invalid', (done) => { + it('returns an error when the specified system value is invalid', function (done) { const connection = new Connection(config); const work = new iWork(connection); @@ -52,8 +52,8 @@ describe('iWork Functional Tests', () => { }); }); - describe('getSysStatus', () => { - it('returns basic system status information about the signed-on users and batch jobs', (done) => { + describe('getSysStatus', function () { + it('returns basic system status information about the signed-on users and batch jobs', function (done) { const connection = new Connection(config); const work = new iWork(connection); @@ -81,8 +81,8 @@ describe('iWork Functional Tests', () => { }); }); - describe('getSysStatusExt', () => { - it('returns more detailed system status info', (done) => { + describe('getSysStatusExt', function () { + it('returns more detailed system status info', function (done) { const connection = new Connection(config); const work = new iWork(connection); @@ -126,8 +126,8 @@ describe('iWork Functional Tests', () => { }); }); - describe('getJobStatus', () => { - it('returns status of specified job', (done) => { + describe('getJobStatus', function () { + it('returns status of specified job', function (done) { const connection = new Connection(config); const work = new iWork(connection); @@ -142,8 +142,8 @@ describe('iWork Functional Tests', () => { }); }); - describe('getJobInfo', () => { - it('returns info on specfed job', (done) => { + describe('getJobInfo', function () { + it('returns info on specfed job', function (done) { const connection = new Connection(config); const work = new iWork(connection); @@ -191,14 +191,14 @@ describe('iWork Functional Tests', () => { }); }); - describe('getDataArea', () => { - before('check if data area exists for tests', (done) => { + describe('getDataArea', function () { + before('check if data area exists for tests', function (done) { checkObjectExists(config, 'TESTDA', '*DTAARA', (error) => { if (error) { throw error; } done(); }); }); - it('returns contents of a data area', (done) => { + it('returns contents of a data area', function (done) { const connection = new Connection(config); const work = new iWork(connection); diff --git a/test/unit/CommandCallUnit.js b/test/unit/CommandCallUnit.js index 5c33272a..e31ab4cb 100644 --- a/test/unit/CommandCallUnit.js +++ b/test/unit/CommandCallUnit.js @@ -18,9 +18,9 @@ const { expect } = require('chai'); const { CommandCall } = require('../../lib/itoolkit'); -describe('Command Call Unit Tests', () => { - describe('SH command tests', () => { - it('accepts command input and returns XML output', () => { +describe('Command Call Unit Tests', function () { + describe('SH command tests', function () { + it('accepts command input and returns XML output', function () { const command = new CommandCall({ command: 'ls -lah', type: 'sh' }); const expectedXML = 'ls -lah'; @@ -28,7 +28,7 @@ describe('Command Call Unit Tests', () => { expect(command.toXML()).to.be.a('string').and.to.equal(expectedXML); }); - it('accepts command input and options returns with optional attributes', () => { + it('accepts command input and options returns with optional attributes', function () { const options = { error: 'on', before: '65535', after: '37', rows: 'on', }; @@ -41,8 +41,8 @@ describe('Command Call Unit Tests', () => { }); }); - describe('CL command tests', () => { - it('accepts command input and returns XML output', () => { + describe('CL command tests', function () { + it('accepts command input and returns XML output', function () { const command = new CommandCall({ command: 'RTVJOBA USRLIBL(?) SYSLIBL(?)', type: 'cl' }); const expectedXML = 'RTVJOBA USRLIBL(?) SYSLIBL(?)'; @@ -50,7 +50,7 @@ describe('Command Call Unit Tests', () => { expect(command.toXML()).to.be.a('string').and.to.equal(expectedXML); }); - it('accepts command input and options returns with optional attributes', () => { + it('accepts command input and options returns with optional attributes', function () { const options = { exec: 'cmd', error: 'on', before: '65535', after: '37', hex: 'on', }; @@ -64,8 +64,8 @@ describe('Command Call Unit Tests', () => { }); }); - describe('QSH command tests', () => { - it('accepts command input and returns XML output', () => { + describe('QSH command tests', function () { + it('accepts command input and returns XML output', function () { const command = new CommandCall({ command: 'ls -lah', type: 'qsh' }); const expectedXML = 'ls -lah'; @@ -73,7 +73,7 @@ describe('Command Call Unit Tests', () => { expect(command.toXML()).to.be.a('string').and.to.equal(expectedXML); }); - it('accepts command input and options returns with optional attributes', () => { + it('accepts command input and options returns with optional attributes', function () { const options = { error: 'on', before: '65535', after: '37', rows: 'on', }; diff --git a/test/unit/ConnectionUnit.js b/test/unit/ConnectionUnit.js index 21489838..fd27662d 100644 --- a/test/unit/ConnectionUnit.js +++ b/test/unit/ConnectionUnit.js @@ -15,15 +15,13 @@ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/* eslint-disable new-cap */ - const { expect } = require('chai'); const sinon = require('sinon'); const { Connection, CommandCall } = require('../../lib/itoolkit'); -describe('Connection Class Unit Tests', () => { - describe('constructor', () => { - it('creates and returns an instance of Connection with idb transport', () => { +describe('Connection Class Unit Tests', function () { + describe('constructor', function () { + it('creates and returns an instance of Connection with idb transport', function () { const options = { transport: 'idb', transportOptions: { @@ -45,7 +43,7 @@ describe('Connection Class Unit Tests', () => { expect(connection.commandList.length).to.equal(0); }); - it('creates and returns an instance of Connection with rest transport', () => { + it('creates and returns an instance of Connection with rest transport', function () { const options = { transport: 'rest', transportOptions: { @@ -78,8 +76,8 @@ describe('Connection Class Unit Tests', () => { }); }); - describe('add', () => { - it('appends to xml service request to the command list using Connection class', () => { + describe('add', function () { + it('appends to xml service request to the command list using Connection class', function () { const options = { transport: 'idb', transportOptions: { @@ -97,8 +95,8 @@ describe('Connection Class Unit Tests', () => { }); - describe('debug', () => { - it('turns verbose mode on/off using Connection class', () => { + describe('debug', function () { + it('turns verbose mode on/off using Connection class', function () { const options = { transport: 'idb', transportOptions: { @@ -117,8 +115,8 @@ describe('Connection Class Unit Tests', () => { }); - describe('getTransportOptions', () => { - it('returns conn (object) property from Connection instance', () => { + describe('getTransportOptions', function () { + it('returns conn (object) property from Connection instance', function () { const options = { transport: 'rest', transportOptions: { @@ -149,8 +147,8 @@ describe('Connection Class Unit Tests', () => { }); - describe('run', () => { - it('(Connection) invokes transport to execute xml input and returns xml output in callback', () => { + describe('run', function () { + it('(Connection) invokes transport to execute xml input and returns xml output in callback', function () { const options = { transport: 'idb', transportOptions: { diff --git a/test/unit/ProgamCallUnit.js b/test/unit/ProgamCallUnit.js index 7bdc08a9..d57c76af 100644 --- a/test/unit/ProgamCallUnit.js +++ b/test/unit/ProgamCallUnit.js @@ -15,8 +15,6 @@ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/* eslint-disable new-cap */ - const { expect } = require('chai'); const { ProgramCall } = require('../../lib/itoolkit'); @@ -37,16 +35,16 @@ const errno = [ { type: '1A', value: '' }, ]; -describe('ProgramCall Class Unit Tests', () => { - describe('constructor', () => { - it('creates and returns an instance of ProgramCall with lib and function set', () => { +describe('ProgramCall Class Unit Tests', function () { + describe('constructor', function () { + it('creates and returns an instance of ProgramCall with lib and function set', function () { const pgm = new ProgramCall('QTOCNETSTS'); expect(pgm).to.be.instanceOf(ProgramCall); }); }); - describe('toXML', () => { - it('returns pgm XML', () => { + describe('toXML', function () { + it('returns pgm XML', function () { const pgm = new ProgramCall('QTOCNETSTS', { lib: 'QSYS', @@ -60,8 +58,8 @@ describe('ProgramCall Class Unit Tests', () => { }); }); - describe('addParam', () => { - it('appends param to pgm xml', () => { + describe('addParam', function () { + it('appends param to pgm xml', function () { const pgm = new ProgramCall('QTOCNETSTS', { lib: 'QSYS', @@ -134,7 +132,7 @@ describe('ProgramCall Class Unit Tests', () => { expect(pgm.toXML()).to.equal(expectedXML); }); - it('regular contains by=\'val\'', () => { + it('regular contains by=\'val\'', function () { const pgm = new ProgramCall('MYPGM', { lib: 'MYLIB', func: 'MY_PROCEDURE' }); pgm.addParam({ value: '', type: '1A', by: 'val' }); @@ -144,7 +142,7 @@ describe('ProgramCall Class Unit Tests', () => { expect(lookAtXML).to.match(//); }); - it('data structure contains by=\'val\'', () => { + it('data structure contains by=\'val\'', function () { const pgm = new ProgramCall('MYPGM', { lib: 'MYLIB', func: 'MY_PROCEDURE' }); const params = [ @@ -161,7 +159,7 @@ describe('ProgramCall Class Unit Tests', () => { expect(lookAtXML).to.match(//); }); - it('regular contains by=\'val\', with io=\'both\'', () => { + it('regular contains by=\'val\', with io=\'both\'', function () { const pgm = new ProgramCall('MYPGM', { lib: 'MYLIB', func: 'MY_PROCEDURE' }); pgm.addParam({ @@ -174,7 +172,7 @@ describe('ProgramCall Class Unit Tests', () => { expect(lookAtXML).to.match(//); }); - it('data structure contains by=\'val\', with io=\'both\'', () => { + it('data structure contains by=\'val\', with io=\'both\'', function () { const pgm = new ProgramCall('MYPGM', { lib: 'MYLIB', func: 'MY_PROCEDURE' }); const params = [ @@ -192,7 +190,7 @@ describe('ProgramCall Class Unit Tests', () => { expect(lookAtXML).to.match(//); }); - it('add nested data structure parameter', () => { + it('add nested data structure parameter', function () { const pgm = new ProgramCall('MYPGM', { lib: 'MYLIB' }); const nestedDs = { @@ -238,8 +236,8 @@ describe('ProgramCall Class Unit Tests', () => { }); - describe('addReturn', () => { - it('appends return to pgm xml', () => { + describe('addReturn', function () { + it('appends return to pgm xml', function () { const pgm = new ProgramCall('QTOCNETSTS', { lib: 'QSYS', @@ -255,7 +253,7 @@ describe('ProgramCall Class Unit Tests', () => { expect(pgm.toXML()).to.equal(expectedXML); }); - it('appends return with ds to pgm xml', () => { + it('appends return with ds to pgm xml', function () { const pgm = new ProgramCall('TEST'); const ds = { diff --git a/test/unit/deprecated/commandsUnit.js b/test/unit/deprecated/commandsUnit.js index 87a22690..1bc7cba1 100644 --- a/test/unit/deprecated/commandsUnit.js +++ b/test/unit/deprecated/commandsUnit.js @@ -15,13 +15,12 @@ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/* eslint-env mocha */ const { expect } = require('chai'); const { iSh, iQsh, iCmd } = require('../../../lib/itoolkit'); -describe('iSh, iCmd, iQsh, Unit Tests', () => { - describe('iSh function', () => { - it('accepts command input and returns XML output', () => { +describe('iSh, iCmd, iQsh, Unit Tests', function () { + describe('iSh function', function () { + it('accepts command input and returns XML output', function () { const sh = iSh('ls -lah'); const expectedXML = 'ls -lah'; @@ -29,7 +28,7 @@ describe('iSh, iCmd, iQsh, Unit Tests', () => { expect(sh).to.be.a('string').and.to.equal(expectedXML); }); - it('accepts command input and options returns with optional attributes', () => { + it('accepts command input and options returns with optional attributes', function () { const options = { error: 'on', before: '65535', after: '37', rows: 'on', }; @@ -42,8 +41,8 @@ describe('iSh, iCmd, iQsh, Unit Tests', () => { }); }); - describe('iCmd function', () => { - it('accepts command input and returns XML output', () => { + describe('iCmd function', function () { + it('accepts command input and returns XML output', function () { const cmd = iCmd('RTVJOBA USRLIBL(?) SYSLIBL(?)'); const expectedXML = 'RTVJOBA USRLIBL(?) SYSLIBL(?)'; @@ -51,7 +50,7 @@ describe('iSh, iCmd, iQsh, Unit Tests', () => { expect(cmd).to.be.a('string').and.to.equal(expectedXML); }); - it('accepts command input and options returns with optional attributes', () => { + it('accepts command input and options returns with optional attributes', function () { const options = { exec: 'cmd', error: 'on', before: '65535', after: '37', hex: 'on', }; @@ -65,8 +64,8 @@ describe('iSh, iCmd, iQsh, Unit Tests', () => { }); }); - describe('iQsh function', () => { - it('accepts command input and returns XML output', () => { + describe('iQsh function', function () { + it('accepts command input and returns XML output', function () { const qsh = iQsh('RTVJOBA USRLIBL(?) SYSLIBL(?)'); const expectedXML = 'RTVJOBA USRLIBL(?) SYSLIBL(?)'; @@ -74,7 +73,7 @@ describe('iSh, iCmd, iQsh, Unit Tests', () => { expect(qsh).to.be.a('string').and.to.equal(expectedXML); }); - it('accepts command input and options returns with optional attributes', () => { + it('accepts command input and options returns with optional attributes', function () { const options = { error: 'on', before: '65535', after: '37', rows: 'on', }; diff --git a/test/unit/deprecated/iConnUnit.js b/test/unit/deprecated/iConnUnit.js index d6882a6f..2160c805 100644 --- a/test/unit/deprecated/iConnUnit.js +++ b/test/unit/deprecated/iConnUnit.js @@ -21,9 +21,9 @@ const { expect } = require('chai'); const sinon = require('sinon'); const { iConn, iSh } = require('../../../lib/itoolkit'); -describe('iConn Class Unit Tests', () => { - describe('constructor', () => { - it('creates and returns an instance of iConn with idb transport', () => { +describe('iConn Class Unit Tests', function () { + describe('constructor', function () { + it('creates and returns an instance of iConn with idb transport', function () { const database = process.env.TKDB || '*LOCAL'; const username = process.env.TKUSER || ''; const password = process.env.TKPASS || ''; @@ -41,7 +41,7 @@ describe('iConn Class Unit Tests', () => { expect(connection.connection.verbose).to.equal(false); }); - it('creates and returns an instance of iConn with rest transport', () => { + it('creates and returns an instance of iConn with rest transport', function () { const database = process.env.TKDB || '*LOCAL'; const username = process.env.TKUSER || ''; const password = process.env.TKPASS || ''; @@ -72,8 +72,8 @@ describe('iConn Class Unit Tests', () => { }); }); - describe('add', () => { - it('appends to xml service request to the command list using iConn class', () => { + describe('add', function () { + it('appends to xml service request to the command list using iConn class', function () { const database = process.env.TKDB || '*LOCAL'; const username = process.env.TKUSER || ''; const password = process.env.TKPASS || ''; @@ -86,8 +86,8 @@ describe('iConn Class Unit Tests', () => { }); - describe('debug', () => { - it('turns verbose mode on/off using iConn class', () => { + describe('debug', function () { + it('turns verbose mode on/off using iConn class', function () { const database = process.env.TKDB || '*LOCAL'; const username = process.env.TKUSER || ''; const password = process.env.TKPASS || ''; @@ -101,8 +101,8 @@ describe('iConn Class Unit Tests', () => { }); - describe('getTransportOptions', () => { - it('returns conn (object) property from iConn instance', () => { + describe('getTransportOptions', function () { + it('returns conn (object) property from iConn instance', function () { const database = process.env.TKDB || '*LOCAL'; const username = process.env.TKUSER || ''; const password = process.env.TKPASS || ''; @@ -120,8 +120,8 @@ describe('iConn Class Unit Tests', () => { }); - describe('run', () => { - it('(iConn) invokes transport to execute xml input and returns xml output in callback', () => { + describe('run', function () { + it('(iConn) invokes transport to execute xml input and returns xml output in callback', function () { const database = process.env.TKDB || '*LOCAL'; const username = process.env.TKUSER || ''; const password = process.env.TKPASS || ''; diff --git a/test/unit/deprecated/iPgmUnit.js b/test/unit/deprecated/iPgmUnit.js index 98bcb724..08c240d5 100644 --- a/test/unit/deprecated/iPgmUnit.js +++ b/test/unit/deprecated/iPgmUnit.js @@ -37,16 +37,16 @@ const errno = [ ['', '1A'], ]; -describe('iPgm Class Unit Tests', () => { - describe('constructor', () => { - it('creates and returns an instance of iPgm with lib and function set', () => { +describe('iPgm Class Unit Tests', function () { + describe('constructor', function () { + it('creates and returns an instance of iPgm with lib and function set', function () { const pgm = new iPgm('QTOCNETSTS'); expect(pgm).to.be.instanceOf(iPgm); }); }); - describe('toXML', () => { - it('returns pgm XML', () => { + describe('toXML', function () { + it('returns pgm XML', function () { const pgm = new iPgm('QTOCNETSTS', { lib: 'QSYS', @@ -60,8 +60,8 @@ describe('iPgm Class Unit Tests', () => { }); }); - describe('addParam', () => { - it('appends param to pgm xml', () => { + describe('addParam', function () { + it('appends param to pgm xml', function () { const pgm = new iPgm('QTOCNETSTS', { lib: 'QSYS', @@ -132,7 +132,7 @@ describe('iPgm Class Unit Tests', () => { expect(pgm.toXML()).to.equal(expectedXML); }); - it('regular contains by=\'val\'', () => { + it('regular contains by=\'val\'', function () { const pgm = new iPgm('MYPGM', { lib: 'MYLIB', func: 'MY_PROCEDURE' }); pgm.addParam('', '1A', { by: 'val' }); @@ -142,7 +142,7 @@ describe('iPgm Class Unit Tests', () => { expect(lookAtXML).to.match(//); }); - it('data structure contains by=\'val\'', () => { + it('data structure contains by=\'val\'', function () { const pgm = new iPgm('MYPGM', { lib: 'MYLIB', func: 'MY_PROCEDURE' }); const params = [ @@ -157,7 +157,7 @@ describe('iPgm Class Unit Tests', () => { expect(lookAtXML).to.match(//); }); - it('regular contains by=\'val\', with io=\'both\'', () => { + it('regular contains by=\'val\', with io=\'both\'', function () { const pgm = new iPgm('MYPGM', { lib: 'MYLIB', func: 'MY_PROCEDURE' }); pgm.addParam('', '1A', { by: 'val', io: 'both' }); @@ -168,7 +168,7 @@ describe('iPgm Class Unit Tests', () => { expect(lookAtXML).to.match(//); }); - it('data structure contains by=\'val\', with io=\'both\'', () => { + it('data structure contains by=\'val\', with io=\'both\'', function () { const pgm = new iPgm('MYPGM', { lib: 'MYLIB', func: 'MY_PROCEDURE' }); const params = [ @@ -186,8 +186,8 @@ describe('iPgm Class Unit Tests', () => { }); - describe('addReturn', () => { - it('appends return to pgm xml', () => { + describe('addReturn', function () { + it('appends return to pgm xml', function () { const pgm = new iPgm('QTOCNETSTS', { lib: 'QSYS', diff --git a/test/unit/deprecated/iSqlUnit.js b/test/unit/deprecated/iSqlUnit.js index 8c013b8b..49bd6661 100644 --- a/test/unit/deprecated/iSqlUnit.js +++ b/test/unit/deprecated/iSqlUnit.js @@ -20,16 +20,16 @@ const { expect } = require('chai'); const { iSql } = require('../../../lib/itoolkit'); -describe('iSql Class Unit Tests', () => { - describe('constructor', () => { - it('creates returns an instance of iSql', () => { +describe('iSql Class Unit Tests', function () { + describe('constructor', function () { + it('creates returns an instance of iSql', function () { const sql = new iSql(); expect(sql).to.be.instanceOf(iSql); }); }); - describe('toXML', () => { - it('returns current sql XML', () => { + describe('toXML', function () { + it('returns current sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -37,8 +37,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('addQuery', () => { - it('appends query with error is on to sql XML', () => { + describe('addQuery', function () { + it('appends query with error is on to sql XML', function () { const sql = new iSql(); const expectedXML = 'select * from QIWS.QCUSTCDT'; @@ -47,7 +47,7 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); - it('appends query with options object to sql XML', () => { + it('appends query with options object to sql XML', function () { const sql = new iSql(); const expectedXML = 'select * from QIWS.QCUSTCDT'; @@ -57,8 +57,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('fetch', () => { - it('appends fetch without options object to sql XML', () => { + describe('fetch', function () { + it('appends fetch without options object to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -66,7 +66,7 @@ describe('iSql Class Unit Tests', () => { sql.fetch(); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends fetch with block is 10 to sql XML', () => { + it('appends fetch with block is 10 to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -74,7 +74,7 @@ describe('iSql Class Unit Tests', () => { sql.fetch({ block: '10' }); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends fetch with desc is off to sql XML', () => { + it('appends fetch with desc is off to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -82,7 +82,7 @@ describe('iSql Class Unit Tests', () => { sql.fetch({ desc: 'off' }); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends fetch with error is on to sql XML', () => { + it('appends fetch with error is on to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -91,8 +91,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('commit', () => { - it('appends commit with action commit to sql XML', () => { + describe('commit', function () { + it('appends commit with action commit to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -100,7 +100,7 @@ describe('iSql Class Unit Tests', () => { sql.commit({ action: 'commit' }); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends commit with action rollback to sql XML', () => { + it('appends commit with action rollback to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -108,7 +108,7 @@ describe('iSql Class Unit Tests', () => { sql.commit({ action: 'rollback' }); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends commit with default action to sql XML', () => { + it('appends commit with default action to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -116,7 +116,7 @@ describe('iSql Class Unit Tests', () => { sql.commit(); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends commit with error is on to sql XML', () => { + it('appends commit with error is on to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -125,8 +125,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('prepare', () => { - it('appends prepare to sql XML', () => { + describe('prepare', function () { + it('appends prepare to sql XML', function () { const sql = new iSql(); const expectedXML = 'SELECT * FROM QIWS.QCUSTCDT WHERE BALDUE > ?'; @@ -134,7 +134,7 @@ describe('iSql Class Unit Tests', () => { sql.prepare('SELECT * FROM QIWS.QCUSTCDT WHERE BALDUE > ?'); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends prepare with error on to sql XML', () => { + it('appends prepare with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'SELECT * FROM QIWS.QCUSTCDT WHERE BALDUE > ?'; @@ -144,8 +144,8 @@ describe('iSql Class Unit Tests', () => { }); }); - describe('execute', () => { - it('appends execute with parameters to sql XML', () => { + describe('execute', function () { + it('appends execute with parameters to sql XML', function () { const sql = new iSql(); const expectedXML = '30'; @@ -153,7 +153,7 @@ describe('iSql Class Unit Tests', () => { sql.execute([[30, 'in']]); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends execute with parameters and error on to sql XML', () => { + it('appends execute with parameters and error on to sql XML', function () { const sql = new iSql(); const expectedXML = '30'; @@ -161,7 +161,7 @@ describe('iSql Class Unit Tests', () => { sql.execute([[30, 'in']], { error: 'on' }); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends execute without parameters to sql XML', () => { + it('appends execute without parameters to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -169,7 +169,7 @@ describe('iSql Class Unit Tests', () => { sql.execute(); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends execute without parameters and error on to sql XML', () => { + it('appends execute without parameters and error on to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -178,8 +178,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('tables', () => { - it('appends tables to sql XML', () => { + describe('tables', function () { + it('appends tables to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWS'; @@ -187,7 +187,7 @@ describe('iSql Class Unit Tests', () => { sql.tables(['', 'QIWS', '', '']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends tables with error on to sql XML', () => { + it('appends tables with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWS'; @@ -196,8 +196,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('tablePriv', () => { - it('appends tablepriv to sql XML', () => { + describe('tablePriv', function () { + it('appends tablepriv to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDT'; @@ -205,7 +205,7 @@ describe('iSql Class Unit Tests', () => { sql.tablePriv(['', 'QIWS', 'QCUSTCDT']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends tablepriv with error on to sql XML', () => { + it('appends tablepriv with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDT'; @@ -214,8 +214,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('columns', () => { - it('appends columns to sql XML', () => { + describe('columns', function () { + it('appends columns to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDT'; @@ -223,7 +223,7 @@ describe('iSql Class Unit Tests', () => { sql.columns(['', 'QIWS', 'QCUSTCDT', '']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends columns with error on to sql XML', () => { + it('appends columns with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDT'; @@ -232,8 +232,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('columnPriv', () => { - it('appends columnpriv to sql XML', () => { + describe('columnPriv', function () { + it('appends columnpriv to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDT'; @@ -241,7 +241,7 @@ describe('iSql Class Unit Tests', () => { sql.columnPriv(['', 'QIWS', 'QCUSTCDT', '']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends columnpriv with error on to sql XML', () => { + it('appends columnpriv with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDT'; @@ -250,8 +250,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('procedures', () => { - it('appends procedures to sql XML', () => { + describe('procedures', function () { + it('appends procedures to sql XML', function () { const sql = new iSql(); const expectedXML = 'QSYS2TCPIP_INFO'; @@ -259,7 +259,7 @@ describe('iSql Class Unit Tests', () => { sql.procedures(['', 'QSYS2', 'TCPIP_INFO']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends procedures with error on to sql XML', () => { + it('appends procedures with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'QSYS2TCPIP_INFO'; @@ -268,8 +268,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('pColumns', () => { - it('appends pColumns to sql XML', () => { + describe('pColumns', function () { + it('appends pColumns to sql XML', function () { // procedure columns: const sql = new iSql(); @@ -278,7 +278,7 @@ describe('iSql Class Unit Tests', () => { sql.pColumns(['', 'QSYS2', 'QCMDEXC', 'COMMAND']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends pColumns with error on to sql XML', () => { + it('appends pColumns with error on to sql XML', function () { // procedure columns: const sql = new iSql(); @@ -288,8 +288,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('primaryKeys', () => { - it('appends primarykeys to sql XML', () => { + describe('primaryKeys', function () { + it('appends primarykeys to sql XML', function () { const sql = new iSql(); const expectedXML = 'QUSRSYSQASZRAIRX'; @@ -297,7 +297,7 @@ describe('iSql Class Unit Tests', () => { sql.primaryKeys(['', 'QUSRSYS', 'QASZRAIRX']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends primarykeys with error on to sql XML', () => { + it('appends primarykeys with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'QUSRSYSQASZRAIRX'; @@ -306,8 +306,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('foreignKeys', () => { - it('appends foreignkeys to sql XML', () => { + describe('foreignKeys', function () { + it('appends foreignkeys to sql XML', function () { const sql = new iSql(); const expectedXML = 'QUSRSYSQASZRAIRCQUSRSYSQASZRAIRX'; @@ -317,7 +317,7 @@ describe('iSql Class Unit Tests', () => { sql.foreignKeys(['', 'QUSRSYS', 'QASZRAIRC', '', 'QUSRSYS', 'QASZRAIRX']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends foreignkeys with error on to sql XML', () => { + it('appends foreignkeys with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'QUSRSYSQASZRAIRCQUSRSYSQASZRAIRX'; @@ -328,8 +328,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('statistics', () => { - it('appends statistics to sql XML', () => { + describe('statistics', function () { + it('appends statistics to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDTall'; @@ -337,7 +337,7 @@ describe('iSql Class Unit Tests', () => { sql.statistics(['', 'QIWS', 'QCUSTCDT', 'all']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends statistics with error on to sql XML', () => { + it('appends statistics with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDTall'; @@ -346,8 +346,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('special', () => { - it('appends special to sql XML', () => { + describe('special', function () { + it('appends special to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDTrowno'; @@ -355,7 +355,7 @@ describe('iSql Class Unit Tests', () => { sql.special(['', 'QIWS', 'QCUSTCDT', 'row', 'no']); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends special with error on to sql XML', () => { + it('appends special with error on to sql XML', function () { const sql = new iSql(); const expectedXML = 'QIWSQCUSTCDTrowno'; @@ -364,22 +364,22 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('count', () => { - it('appends count to sql XML', () => { + describe('count', function () { + it('appends count to sql XML', function () { const sql = new iSql(); const expectedXML = ''; sql.count({ desc: 'both' }); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends count without options object to sql XML', () => { + it('appends count without options object to sql XML', function () { const sql = new iSql(); const expectedXML = ''; sql.count(); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends count with error on to sql XML', () => { + it('appends count with error on to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -387,15 +387,15 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('rowCount', () => { - it('appends rowcount to sql XML', () => { + describe('rowCount', function () { + it('appends rowcount to sql XML', function () { const sql = new iSql(); const expectedXML = ''; sql.rowCount(); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends rowcount with error on to sql XML', () => { + it('appends rowcount with error on to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -403,8 +403,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('free', () => { - it('appends free to sql XML', () => { + describe('free', function () { + it('appends free to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -412,8 +412,8 @@ describe('iSql Class Unit Tests', () => { expect(sql.toXML()).to.equal(expectedXML); }); }); - describe('describe', () => { - it('appends describe to sql XML', () => { + describe('describe', function () { + it('appends describe to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -421,7 +421,7 @@ describe('iSql Class Unit Tests', () => { sql.describe({ desc: 'both' }); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends describe without options object to sql XML', () => { + it('appends describe without options object to sql XML', function () { const sql = new iSql(); const expectedXML = ''; @@ -429,7 +429,7 @@ describe('iSql Class Unit Tests', () => { sql.describe(); expect(sql.toXML()).to.equal(expectedXML); }); - it('appends describe with error on to sql XML', () => { + it('appends describe with error on to sql XML', function () { const sql = new iSql(); const expectedXML = ''; diff --git a/test/unit/deprecated/xmlToJsonUnit.js b/test/unit/deprecated/xmlToJsonUnit.js index 2d487be6..60d6d728 100644 --- a/test/unit/deprecated/xmlToJsonUnit.js +++ b/test/unit/deprecated/xmlToJsonUnit.js @@ -18,8 +18,8 @@ const { expect } = require('chai'); const { xmlToJson } = require('../../../lib/itoolkit'); -describe('xmlToJson Tests', () => { - it('converts CL command XML output to js object', () => { +describe('xmlToJson Tests', function () { + it('converts CL command XML output to js object', function () { const xmlOut = '' + '+++ success RTVJOBA USRLIBL(?) SYSLIBL(?)' + 'QGPL QTEMP QDEVELOP QBLDSYS' @@ -43,7 +43,7 @@ describe('xmlToJson Tests', () => { expect(result[0].data[0]).to.haveOwnProperty('value').and.to.equal(value); }); - it('converts sh command XML output to js object', () => { + it('converts sh command XML output to js object', function () { const xmlOut = '\n' + 'bin\n' + 'ccs\n' @@ -70,7 +70,7 @@ describe('xmlToJson Tests', () => { }); - it('converts qsh command XML output to js object', () => { + it('converts qsh command XML output to js object', function () { const xmlOut = '\n' + 'bin\n' + 'ccs\n' @@ -96,7 +96,7 @@ describe('xmlToJson Tests', () => { expect(result[0]).to.haveOwnProperty('data').and.to.equal(data); }); - it('converts pgm command XML output to js object', () => { + it('converts pgm command XML output to js object', function () { const xmlOut = ` @@ -150,7 +150,7 @@ describe('xmlToJson Tests', () => { }); }); - it('converts sql command XML output to js object', () => { + it('converts sql command XML output to js object', function () { const xmlOut = `