Skip to content

Commit 9cb7543

Browse files
authored
test: Remove arrow functions from mocha functions (#283)
1 parent 89e67e6 commit 9cb7543

27 files changed

+374
-383
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ module.exports = {
2727
'prefer-arrow-callback': 'off',
2828

2929
// The following rules cause problems for our existing tests, so they are disabled for now:
30-
'mocha/no-mocha-arrows': 'off',
3130
'mocha/no-skipped-tests': 'off',
3231
'mocha/no-hooks-for-single-case': 'off',
3332
'mocha/no-identical-title': 'off',

test/functional/CommandCallFunctional.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ const { CommandCall, Connection } = require('../../lib/itoolkit');
2121
const { config, printConfig } = require('./config');
2222

2323

24-
describe('CommandCall Functional Tests', () => {
25-
before(() => {
24+
describe('CommandCall Functional Tests', function () {
25+
before(function () {
2626
printConfig();
2727
});
2828

29-
describe('CL command tests', () => {
30-
it('calls CL command', (done) => {
29+
describe('CL command tests', function () {
30+
it('calls CL command', function (done) {
3131
const connection = new Connection(config);
3232
connection.add(new CommandCall({ command: 'RTVJOBA USRLIBL(?) SYSLIBL(?)', type: 'cl' }));
3333
connection.run((error, xmlOut) => {
@@ -41,8 +41,8 @@ describe('CommandCall Functional Tests', () => {
4141
});
4242
});
4343

44-
describe('SH command tests', () => {
45-
it('calls PASE shell command', (done) => {
44+
describe('SH command tests', function () {
45+
it('calls PASE shell command', function (done) {
4646
const connection = new Connection(config);
4747
connection.add(new CommandCall({ command: 'system -i wrksyssts', type: 'sh' }));
4848
connection.run((error, xmlOut) => {
@@ -58,8 +58,8 @@ describe('CommandCall Functional Tests', () => {
5858
});
5959
});
6060

61-
describe('QSH command tests', () => {
62-
it('calls QSH command', (done) => {
61+
describe('QSH command tests', function () {
62+
it('calls QSH command', function (done) {
6363
const connection = new Connection(config);
6464
connection.add(new CommandCall({ command: 'system wrksyssts', type: 'qsh' }));
6565
connection.run((error, xmlOut) => {

test/functional/ProgramCallFunctional.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,19 @@
1515
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1616
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1717

18-
1918
const { expect } = require('chai');
2019
const { parseString } = require('xml2js');
2120
const { ProgramCall, Connection } = require('../../lib/itoolkit');
2221
const { config, printConfig } = require('./config');
2322

2423

25-
describe('ProgramCall Functional Tests', () => {
26-
before(() => {
24+
describe('ProgramCall Functional Tests', function () {
25+
before(function () {
2726
printConfig();
2827
});
2928

30-
describe('Test ProgramCall()', () => {
31-
it('calls QWCRSVAL program checks if it ran successfully', (done) => {
29+
describe('Test ProgramCall()', function () {
30+
it('calls QWCRSVAL program checks if it ran successfully', function (done) {
3231
const connection = new Connection(config);
3332

3433
const program = new ProgramCall('QWCRSVAL', { lib: 'QSYS' });
@@ -82,10 +81,10 @@ describe('ProgramCall Functional Tests', () => {
8281
});
8382
});
8483

85-
describe.skip('Test ProgramCall()', () => {
84+
describe.skip('Test ProgramCall()', function () {
8685
// ZZSRV6 program requires XMLSERVICE built with tests
8786
// Skip for now, we need to add before hook to check ZZSRV6 is available
88-
it.skip('Should be successful with addReturn arbitrary attribute specified', (done) => {
87+
it.skip('Should be successful with addReturn arbitrary attribute specified', function (done) {
8988
const connection = new Connection(config);
9089

9190
const program = new ProgramCall('ZZSRV6', { lib: 'XMLSERVICE', func: 'ZZVARY4' });

test/functional/deprecated/commandsFunctional.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
/* eslint-disable new-cap */
1919

20-
2120
const { expect } = require('chai');
2221
const { parseString } = require('xml2js');
2322
const {
@@ -45,13 +44,13 @@ if (config.transport === 'rest') {
4544
};
4645
}
4746

48-
describe('iSh, iCmd, iQsh, Functional Tests', () => {
49-
before(() => {
47+
describe('iSh, iCmd, iQsh, Functional Tests', function () {
48+
before(function () {
5049
printConfig();
5150
});
5251

53-
describe('iCmd()', () => {
54-
it('calls CL command', (done) => {
52+
describe('iCmd()', function () {
53+
it('calls CL command', function (done) {
5554
const connection = new iConn(database, username, password, restOptions);
5655
connection.add(iCmd('RTVJOBA USRLIBL(?) SYSLIBL(?)'));
5756
connection.run((xmlOut) => {
@@ -64,8 +63,8 @@ describe('iSh, iCmd, iQsh, Functional Tests', () => {
6463
});
6564
});
6665

67-
describe('iSh()', () => {
68-
it('calls PASE shell command', (done) => {
66+
describe('iSh()', function () {
67+
it('calls PASE shell command', function (done) {
6968
const connection = new iConn(database, username, password, restOptions);
7069
connection.add(iSh('system -i wrksyssts'));
7170
connection.run((xmlOut) => {
@@ -80,8 +79,8 @@ describe('iSh, iCmd, iQsh, Functional Tests', () => {
8079
});
8180
});
8281

83-
describe('iQsh()', () => {
84-
it('calls QSH command', (done) => {
82+
describe('iQsh()', function () {
83+
it('calls QSH command', function (done) {
8584
const connection = new iConn(database, username, password, restOptions);
8685
connection.add(iQsh('system wrksyssts'));
8786
connection.run((xmlOut) => {

test/functional/deprecated/iDataQueueFunctional.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,26 @@ if (config.transport === 'rest') {
4444

4545
const lib = 'NODETKTEST'; const dqName = 'TESTQ';
4646

47-
describe('iDataQueue Functional Tests', () => {
48-
before('check if data queue exists for tests', (done) => {
47+
describe('iDataQueue Functional Tests', function () {
48+
before('check if data queue exists for tests', function (done) {
4949
printConfig();
5050
checkObjectExists(config, dqName, '*DTAQ', (error) => {
5151
if (error) { throw error; }
5252
done();
5353
});
5454
});
5555

56-
describe('constructor', () => {
57-
it('creates and returns an instance of iDataQueue', () => {
56+
describe('constructor', function () {
57+
it('creates and returns an instance of iDataQueue', function () {
5858
const connection = new iConn(database, config.user, password);
5959

6060
const dq = new iDataQueue(connection);
6161
expect(dq).to.be.instanceOf(iDataQueue);
6262
});
6363
});
6464

65-
describe('sendToDataQueue', () => {
66-
it('sends data to specified DQ', (done) => {
65+
describe('sendToDataQueue', function () {
66+
it('sends data to specified DQ', function (done) {
6767
const connection = new iConn(database, username, password, restOptions);
6868

6969
const dq = new iDataQueue(connection);
@@ -75,8 +75,8 @@ describe('iDataQueue Functional Tests', () => {
7575
});
7676
});
7777

78-
describe('receiveFromDataQueue', () => {
79-
it('receives data from specfied DQ', (done) => {
78+
describe('receiveFromDataQueue', function () {
79+
it('receives data from specfied DQ', function (done) {
8080
const connection = new iConn(database, username, password, restOptions);
8181

8282
const dq = new iDataQueue(connection);
@@ -88,8 +88,8 @@ describe('iDataQueue Functional Tests', () => {
8888
});
8989
});
9090

91-
describe('clearDataQueue', () => {
92-
it('clears the specifed DQ', (done) => {
91+
describe('clearDataQueue', function () {
92+
it('clears the specifed DQ', function (done) {
9393
const connection = new iConn(database, username, password, restOptions);
9494

9595
const dq = new iDataQueue(connection);

test/functional/deprecated/iNetworkFunctional.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ if (config.transport === 'rest') {
4141
};
4242
}
4343

44-
describe('iNetwork Functional Tests', () => {
45-
before(() => {
44+
describe('iNetwork Functional Tests', function () {
45+
before(function () {
4646
printConfig();
4747
});
4848

49-
describe('constructor', () => {
50-
it('creates and returns an instance of iNetwork', () => {
49+
describe('constructor', function () {
50+
it('creates and returns an instance of iNetwork', function () {
5151
const connection = new iConn(database, config.user, password);
5252

5353
const net = new iNetwork(connection);
@@ -56,8 +56,8 @@ describe('iNetwork Functional Tests', () => {
5656
});
5757
});
5858

59-
describe('getTCPIPAttr', () => {
60-
it('retrieves TCP/IP Attributes', (done) => {
59+
describe('getTCPIPAttr', function () {
60+
it('retrieves TCP/IP Attributes', function (done) {
6161
const connection = new iConn(database, username, password, restOptions);
6262

6363
const net = new iNetwork(connection);
@@ -98,8 +98,8 @@ describe('iNetwork Functional Tests', () => {
9898
});
9999
});
100100

101-
describe('getNetInterfaceData', () => {
102-
it('retrieves IPv4 network interface info', (done) => {
101+
describe('getNetInterfaceData', function () {
102+
it('retrieves IPv4 network interface info', function (done) {
103103
const connection = new iConn(database, username, password, restOptions);
104104

105105
const net = new iNetwork(connection);

test/functional/deprecated/iObjFunctional.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ if (config.transport === 'rest') {
4141
};
4242
}
4343

44-
describe('iObj Functional Tests', () => {
45-
before(() => {
44+
describe('iObj Functional Tests', function () {
45+
before(function () {
4646
printConfig();
4747
});
4848

49-
describe('constructor', () => {
50-
it('creates and returns an instance of iObj', () => {
49+
describe('constructor', function () {
50+
it('creates and returns an instance of iObj', function () {
5151
const connection = new iConn(database, config.user, password);
5252

5353
const obj = new iObj(connection);
@@ -56,8 +56,8 @@ describe('iObj Functional Tests', () => {
5656
});
5757
});
5858

59-
describe('retrUsrAuth', () => {
60-
it(`returns uses's authority for an object using ${config.transport} tranport`, (done) => {
59+
describe('retrUsrAuth', function () {
60+
it(`returns uses's authority for an object using ${config.transport} tranport`, function (done) {
6161
const connection = new iConn(database, username, password, restOptions);
6262

6363
const obj = new iObj(connection);
@@ -100,8 +100,8 @@ describe('iObj Functional Tests', () => {
100100
});
101101
});
102102

103-
describe('rtrCmdInfo', () => {
104-
it('returns command info', (done) => {
103+
describe('rtrCmdInfo', function () {
104+
it('returns command info', function (done) {
105105
const connection = new iConn(database, username, password, restOptions);
106106

107107
const obj = new iObj(connection);
@@ -152,8 +152,8 @@ describe('iObj Functional Tests', () => {
152152
});
153153
});
154154

155-
describe('retrPgmInfo', () => {
156-
it('returns program info', (done) => {
155+
describe('retrPgmInfo', function () {
156+
it('returns program info', function (done) {
157157
const connection = new iConn(database, username, password, restOptions);
158158

159159
const obj = new iObj(connection);
@@ -226,8 +226,8 @@ describe('iObj Functional Tests', () => {
226226
});
227227
});
228228

229-
describe('retrSrvPgmInfo', () => {
230-
it('returns service program info', (done) => {
229+
describe('retrSrvPgmInfo', function () {
230+
it('returns service program info', function (done) {
231231
const connection = new iConn(database, username, password, restOptions);
232232

233233
const obj = new iObj(connection);
@@ -281,8 +281,8 @@ describe('iObj Functional Tests', () => {
281281
});
282282
});
283283

284-
describe('retrUserInfo', () => {
285-
it('returns specified user profile info', (done) => {
284+
describe('retrUserInfo', function () {
285+
it('returns specified user profile info', function (done) {
286286
const connection = new iConn(database, username, password, restOptions);
287287

288288
const obj = new iObj(connection);
@@ -307,8 +307,8 @@ describe('iObj Functional Tests', () => {
307307
});
308308
});
309309

310-
describe('retrUsrAuthToObj', () => {
311-
it(`retrieves info for users who are authorized to an object using ${config.transport} transpsort`, (done) => {
310+
describe('retrUsrAuthToObj', function () {
311+
it(`retrieves info for users who are authorized to an object using ${config.transport} transpsort`, function (done) {
312312
const connection = new iConn(database, username, password, restOptions);
313313

314314
const obj = new iObj(connection);
@@ -334,8 +334,8 @@ describe('iObj Functional Tests', () => {
334334
});
335335
});
336336

337-
describe('addToLibraryList', () => {
338-
it('appends lib to user\'s lib list', (done) => {
337+
describe('addToLibraryList', function () {
338+
it('appends lib to user\'s lib list', function (done) {
339339
const connection = new iConn(database, username, password, restOptions);
340340

341341
const obj = new iObj(connection);

test/functional/deprecated/iPgmFunctional.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ if (config.transport === 'rest') {
4242
};
4343
}
4444

45-
describe('iPgm Functional Tests', () => {
46-
before(() => {
45+
describe('iPgm Functional Tests', function () {
46+
before(function () {
4747
printConfig();
4848
});
4949

50-
describe('Test iPgm()', () => {
51-
it('calls QWCRSVAL program checks if it ran successfully', (done) => {
50+
describe('Test iPgm()', function () {
51+
it('calls QWCRSVAL program checks if it ran successfully', function (done) {
5252
const connection = new iConn(database, username, password, restOptions);
5353

5454
const program = new iPgm('QWCRSVAL', { lib: 'QSYS' });
@@ -79,10 +79,10 @@ describe('iPgm Functional Tests', () => {
7979
});
8080
});
8181

82-
describe.skip('Test iPgm()', () => {
82+
describe.skip('Test iPgm()', function () {
8383
// ZZSRV6 program requires XMLSERVICE built with tests
8484
// Skip for now, we need to add before hook to check if ZZSRV6 is available
85-
it.skip('Should be successful with addReturn arbitrary attribute specified using', (done) => {
85+
it.skip('Should be successful with addReturn arbitrary attribute specified using', function (done) {
8686
const connection = new iConn(database, username, password, restOptions);
8787

8888
const program = new iPgm('ZZSRV6', { lib: 'XMLSERVICE', func: 'ZZVARY4' });

0 commit comments

Comments
 (0)