itoolkit 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.eslintrc.js +37 -11
  2. package/CHANGELOG.md +34 -1
  3. package/README.md +8 -8
  4. package/lib/Connection.js +0 -1
  5. package/lib/Deprecated.js +3 -4
  6. package/lib/ProgramCall.js +2 -2
  7. package/lib/transports/httpTransport.js +2 -2
  8. package/lib/transports/idbTransport.js +23 -11
  9. package/lib/transports/odbcTransport.js +16 -2
  10. package/lib/transports/sshTransport.js +4 -5
  11. package/package.json +15 -14
  12. package/test/README.md +2 -4
  13. package/test/functional/CommandCallFunctional.js +20 -12
  14. package/test/functional/ProgramCallFunctional.js +6 -66
  15. package/test/functional/checkObjectExists.js +12 -1
  16. package/test/functional/checkVersion.js +17 -0
  17. package/test/functional/deprecated/commandsFunctional.js +20 -11
  18. package/test/functional/deprecated/iDataQueueFunctional.js +10 -11
  19. package/test/functional/deprecated/iNetworkFunctional.js +8 -9
  20. package/test/functional/deprecated/iObjFunctional.js +18 -19
  21. package/test/functional/deprecated/iPgmFunctional.js +6 -42
  22. package/test/functional/deprecated/iProdFunctional.js +10 -11
  23. package/test/functional/deprecated/iSqlFunctional.js +30 -32
  24. package/test/functional/deprecated/iUserSpaceFunctional.js +29 -18
  25. package/test/functional/deprecated/iWorkFunctional.js +61 -59
  26. package/test/functional/iDataQueueFunctional.js +8 -9
  27. package/test/functional/iNetworkFunctional.js +6 -8
  28. package/test/functional/iObjFunctional.js +16 -17
  29. package/test/functional/iProdFunctional.js +8 -9
  30. package/test/functional/iSqlFunctional.js +30 -31
  31. package/test/functional/iUserSpaceFunctional.js +27 -16
  32. package/test/functional/iWorkFunctional.js +29 -33
  33. package/test/unit/CommandCallUnit.js +10 -11
  34. package/test/unit/ConnectionUnit.js +12 -19
  35. package/test/unit/ProgamCallUnit.js +27 -25
  36. package/test/unit/deprecated/commandsUnit.js +10 -11
  37. package/test/unit/deprecated/iConnUnit.js +12 -16
  38. package/test/unit/deprecated/iPgmUnit.js +25 -21
  39. package/test/unit/deprecated/iSqlUnit.js +69 -70
  40. package/test/unit/deprecated/xmlToJsonUnit.js +6 -9
@@ -15,22 +15,21 @@
15
15
  // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
16
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
17
 
18
- /* eslint-env mocha */
19
18
  /* eslint-disable new-cap */
20
19
 
21
20
  const { expect } = require('chai');
22
21
  const { iSql } = require('../../../lib/itoolkit');
23
22
 
24
- describe('iSql Class Unit Tests', () => {
25
- describe('constructor', () => {
26
- it('creates returns an instance of iSql', () => {
23
+ describe('iSql Class Unit Tests', function () {
24
+ describe('constructor', function () {
25
+ it('creates returns an instance of iSql', function () {
27
26
  const sql = new iSql();
28
27
 
29
28
  expect(sql).to.be.instanceOf(iSql);
30
29
  });
31
30
  });
32
- describe('toXML', () => {
33
- it('returns current sql XML', () => {
31
+ describe('toXML', function () {
32
+ it('returns current sql XML', function () {
34
33
  const sql = new iSql();
35
34
 
36
35
  const expectedXML = '<sql></sql>';
@@ -38,8 +37,8 @@ describe('iSql Class Unit Tests', () => {
38
37
  expect(sql.toXML()).to.equal(expectedXML);
39
38
  });
40
39
  });
41
- describe('addQuery', () => {
42
- it('appends query with error is on to sql XML', () => {
40
+ describe('addQuery', function () {
41
+ it('appends query with error is on to sql XML', function () {
43
42
  const sql = new iSql();
44
43
 
45
44
  const expectedXML = '<sql><query error=\'on\'>select * from QIWS.QCUSTCDT</query></sql>';
@@ -48,7 +47,7 @@ describe('iSql Class Unit Tests', () => {
48
47
 
49
48
  expect(sql.toXML()).to.equal(expectedXML);
50
49
  });
51
- it('appends query with options object to sql XML', () => {
50
+ it('appends query with options object to sql XML', function () {
52
51
  const sql = new iSql();
53
52
 
54
53
  const expectedXML = '<sql><query error=\'fast\'>select * from QIWS.QCUSTCDT</query></sql>';
@@ -58,8 +57,8 @@ describe('iSql Class Unit Tests', () => {
58
57
  expect(sql.toXML()).to.equal(expectedXML);
59
58
  });
60
59
  });
61
- describe('fetch', () => {
62
- it('appends fetch without options object to sql XML', () => {
60
+ describe('fetch', function () {
61
+ it('appends fetch without options object to sql XML', function () {
63
62
  const sql = new iSql();
64
63
 
65
64
  const expectedXML = '<sql><fetch block=\'all\' desc=\'on\' error=\'fast\'></fetch></sql>';
@@ -67,7 +66,7 @@ describe('iSql Class Unit Tests', () => {
67
66
  sql.fetch();
68
67
  expect(sql.toXML()).to.equal(expectedXML);
69
68
  });
70
- it('appends fetch with block is 10 to sql XML', () => {
69
+ it('appends fetch with block is 10 to sql XML', function () {
71
70
  const sql = new iSql();
72
71
 
73
72
  const expectedXML = '<sql><fetch block=\'10\' desc=\'on\' error=\'fast\'></fetch></sql>';
@@ -75,7 +74,7 @@ describe('iSql Class Unit Tests', () => {
75
74
  sql.fetch({ block: '10' });
76
75
  expect(sql.toXML()).to.equal(expectedXML);
77
76
  });
78
- it('appends fetch with desc is off to sql XML', () => {
77
+ it('appends fetch with desc is off to sql XML', function () {
79
78
  const sql = new iSql();
80
79
 
81
80
  const expectedXML = '<sql><fetch block=\'all\' desc=\'off\' error=\'fast\'></fetch></sql>';
@@ -83,7 +82,7 @@ describe('iSql Class Unit Tests', () => {
83
82
  sql.fetch({ desc: 'off' });
84
83
  expect(sql.toXML()).to.equal(expectedXML);
85
84
  });
86
- it('appends fetch with error is on to sql XML', () => {
85
+ it('appends fetch with error is on to sql XML', function () {
87
86
  const sql = new iSql();
88
87
 
89
88
  const expectedXML = '<sql><fetch block=\'all\' desc=\'on\' error=\'on\'></fetch></sql>';
@@ -92,8 +91,8 @@ describe('iSql Class Unit Tests', () => {
92
91
  expect(sql.toXML()).to.equal(expectedXML);
93
92
  });
94
93
  });
95
- describe('commit', () => {
96
- it('appends commit with action commit to sql XML', () => {
94
+ describe('commit', function () {
95
+ it('appends commit with action commit to sql XML', function () {
97
96
  const sql = new iSql();
98
97
 
99
98
  const expectedXML = '<sql><commit action=\'commit\' error=\'fast\'></commit></sql>';
@@ -101,7 +100,7 @@ describe('iSql Class Unit Tests', () => {
101
100
  sql.commit({ action: 'commit' });
102
101
  expect(sql.toXML()).to.equal(expectedXML);
103
102
  });
104
- it('appends commit with action rollback to sql XML', () => {
103
+ it('appends commit with action rollback to sql XML', function () {
105
104
  const sql = new iSql();
106
105
 
107
106
  const expectedXML = '<sql><commit action=\'rollback\' error=\'fast\'></commit></sql>';
@@ -109,7 +108,7 @@ describe('iSql Class Unit Tests', () => {
109
108
  sql.commit({ action: 'rollback' });
110
109
  expect(sql.toXML()).to.equal(expectedXML);
111
110
  });
112
- it('appends commit with default action to sql XML', () => {
111
+ it('appends commit with default action to sql XML', function () {
113
112
  const sql = new iSql();
114
113
 
115
114
  const expectedXML = '<sql><commit action=\'commit\' error=\'fast\'></commit></sql>';
@@ -117,7 +116,7 @@ describe('iSql Class Unit Tests', () => {
117
116
  sql.commit();
118
117
  expect(sql.toXML()).to.equal(expectedXML);
119
118
  });
120
- it('appends commit with error is on to sql XML', () => {
119
+ it('appends commit with error is on to sql XML', function () {
121
120
  const sql = new iSql();
122
121
 
123
122
  const expectedXML = '<sql><commit action=\'commit\' error=\'on\'></commit></sql>';
@@ -126,8 +125,8 @@ describe('iSql Class Unit Tests', () => {
126
125
  expect(sql.toXML()).to.equal(expectedXML);
127
126
  });
128
127
  });
129
- describe('prepare', () => {
130
- it('appends prepare to sql XML', () => {
128
+ describe('prepare', function () {
129
+ it('appends prepare to sql XML', function () {
131
130
  const sql = new iSql();
132
131
 
133
132
  const expectedXML = '<sql><prepare error=\'fast\'>SELECT * FROM QIWS.QCUSTCDT WHERE BALDUE > ?</prepare></sql>';
@@ -135,7 +134,7 @@ describe('iSql Class Unit Tests', () => {
135
134
  sql.prepare('SELECT * FROM QIWS.QCUSTCDT WHERE BALDUE > ?');
136
135
  expect(sql.toXML()).to.equal(expectedXML);
137
136
  });
138
- it('appends prepare with error on to sql XML', () => {
137
+ it('appends prepare with error on to sql XML', function () {
139
138
  const sql = new iSql();
140
139
 
141
140
  const expectedXML = '<sql><prepare error=\'on\'>SELECT * FROM QIWS.QCUSTCDT WHERE BALDUE > ?</prepare></sql>';
@@ -145,8 +144,8 @@ describe('iSql Class Unit Tests', () => {
145
144
  });
146
145
  });
147
146
 
148
- describe('execute', () => {
149
- it('appends execute with parameters to sql XML', () => {
147
+ describe('execute', function () {
148
+ it('appends execute with parameters to sql XML', function () {
150
149
  const sql = new iSql();
151
150
 
152
151
  const expectedXML = '<sql><execute error=\'fast\'><parm io=\'in\'>30</parm></execute></sql>';
@@ -154,7 +153,7 @@ describe('iSql Class Unit Tests', () => {
154
153
  sql.execute([[30, 'in']]);
155
154
  expect(sql.toXML()).to.equal(expectedXML);
156
155
  });
157
- it('appends execute with parameters and error on to sql XML', () => {
156
+ it('appends execute with parameters and error on to sql XML', function () {
158
157
  const sql = new iSql();
159
158
 
160
159
  const expectedXML = '<sql><execute error=\'on\'><parm io=\'in\'>30</parm></execute></sql>';
@@ -162,7 +161,7 @@ describe('iSql Class Unit Tests', () => {
162
161
  sql.execute([[30, 'in']], { error: 'on' });
163
162
  expect(sql.toXML()).to.equal(expectedXML);
164
163
  });
165
- it('appends execute without parameters to sql XML', () => {
164
+ it('appends execute without parameters to sql XML', function () {
166
165
  const sql = new iSql();
167
166
 
168
167
  const expectedXML = '<sql><execute error=\'fast\'></execute></sql>';
@@ -170,7 +169,7 @@ describe('iSql Class Unit Tests', () => {
170
169
  sql.execute();
171
170
  expect(sql.toXML()).to.equal(expectedXML);
172
171
  });
173
- it('appends execute without parameters and error on to sql XML', () => {
172
+ it('appends execute without parameters and error on to sql XML', function () {
174
173
  const sql = new iSql();
175
174
 
176
175
  const expectedXML = '<sql><execute error=\'on\'></execute></sql>';
@@ -179,8 +178,8 @@ describe('iSql Class Unit Tests', () => {
179
178
  expect(sql.toXML()).to.equal(expectedXML);
180
179
  });
181
180
  });
182
- describe('tables', () => {
183
- it('appends tables to sql XML', () => {
181
+ describe('tables', function () {
182
+ it('appends tables to sql XML', function () {
184
183
  const sql = new iSql();
185
184
 
186
185
  const expectedXML = '<sql><tables error=\'fast\'><parm></parm><parm>QIWS</parm><parm></parm><parm></parm></tables></sql>';
@@ -188,7 +187,7 @@ describe('iSql Class Unit Tests', () => {
188
187
  sql.tables(['', 'QIWS', '', '']);
189
188
  expect(sql.toXML()).to.equal(expectedXML);
190
189
  });
191
- it('appends tables with error on to sql XML', () => {
190
+ it('appends tables with error on to sql XML', function () {
192
191
  const sql = new iSql();
193
192
 
194
193
  const expectedXML = '<sql><tables error=\'on\'><parm></parm><parm>QIWS</parm><parm></parm><parm></parm></tables></sql>';
@@ -197,8 +196,8 @@ describe('iSql Class Unit Tests', () => {
197
196
  expect(sql.toXML()).to.equal(expectedXML);
198
197
  });
199
198
  });
200
- describe('tablePriv', () => {
201
- it('appends tablepriv to sql XML', () => {
199
+ describe('tablePriv', function () {
200
+ it('appends tablepriv to sql XML', function () {
202
201
  const sql = new iSql();
203
202
 
204
203
  const expectedXML = '<sql><tablepriv error=\'fast\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm></tablepriv></sql>';
@@ -206,7 +205,7 @@ describe('iSql Class Unit Tests', () => {
206
205
  sql.tablePriv(['', 'QIWS', 'QCUSTCDT']);
207
206
  expect(sql.toXML()).to.equal(expectedXML);
208
207
  });
209
- it('appends tablepriv with error on to sql XML', () => {
208
+ it('appends tablepriv with error on to sql XML', function () {
210
209
  const sql = new iSql();
211
210
 
212
211
  const expectedXML = '<sql><tablepriv error=\'on\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm></tablepriv></sql>';
@@ -215,8 +214,8 @@ describe('iSql Class Unit Tests', () => {
215
214
  expect(sql.toXML()).to.equal(expectedXML);
216
215
  });
217
216
  });
218
- describe('columns', () => {
219
- it('appends columns to sql XML', () => {
217
+ describe('columns', function () {
218
+ it('appends columns to sql XML', function () {
220
219
  const sql = new iSql();
221
220
 
222
221
  const expectedXML = '<sql><columns error=\'fast\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm><parm></parm></columns></sql>';
@@ -224,7 +223,7 @@ describe('iSql Class Unit Tests', () => {
224
223
  sql.columns(['', 'QIWS', 'QCUSTCDT', '']);
225
224
  expect(sql.toXML()).to.equal(expectedXML);
226
225
  });
227
- it('appends columns with error on to sql XML', () => {
226
+ it('appends columns with error on to sql XML', function () {
228
227
  const sql = new iSql();
229
228
 
230
229
  const expectedXML = '<sql><columns error=\'on\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm><parm></parm></columns></sql>';
@@ -233,8 +232,8 @@ describe('iSql Class Unit Tests', () => {
233
232
  expect(sql.toXML()).to.equal(expectedXML);
234
233
  });
235
234
  });
236
- describe('columnPriv', () => {
237
- it('appends columnpriv to sql XML', () => {
235
+ describe('columnPriv', function () {
236
+ it('appends columnpriv to sql XML', function () {
238
237
  const sql = new iSql();
239
238
 
240
239
  const expectedXML = '<sql><columnpriv error=\'fast\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm><parm></parm></columnpriv></sql>';
@@ -242,7 +241,7 @@ describe('iSql Class Unit Tests', () => {
242
241
  sql.columnPriv(['', 'QIWS', 'QCUSTCDT', '']);
243
242
  expect(sql.toXML()).to.equal(expectedXML);
244
243
  });
245
- it('appends columnpriv with error on to sql XML', () => {
244
+ it('appends columnpriv with error on to sql XML', function () {
246
245
  const sql = new iSql();
247
246
 
248
247
  const expectedXML = '<sql><columnpriv error=\'on\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm><parm></parm></columnpriv></sql>';
@@ -251,8 +250,8 @@ describe('iSql Class Unit Tests', () => {
251
250
  expect(sql.toXML()).to.equal(expectedXML);
252
251
  });
253
252
  });
254
- describe('procedures', () => {
255
- it('appends procedures to sql XML', () => {
253
+ describe('procedures', function () {
254
+ it('appends procedures to sql XML', function () {
256
255
  const sql = new iSql();
257
256
 
258
257
  const expectedXML = '<sql><procedures error=\'fast\'><parm></parm><parm>QSYS2</parm><parm>TCPIP_INFO</parm></procedures></sql>';
@@ -260,7 +259,7 @@ describe('iSql Class Unit Tests', () => {
260
259
  sql.procedures(['', 'QSYS2', 'TCPIP_INFO']);
261
260
  expect(sql.toXML()).to.equal(expectedXML);
262
261
  });
263
- it('appends procedures with error on to sql XML', () => {
262
+ it('appends procedures with error on to sql XML', function () {
264
263
  const sql = new iSql();
265
264
 
266
265
  const expectedXML = '<sql><procedures error=\'on\'><parm></parm><parm>QSYS2</parm><parm>TCPIP_INFO</parm></procedures></sql>';
@@ -269,8 +268,8 @@ describe('iSql Class Unit Tests', () => {
269
268
  expect(sql.toXML()).to.equal(expectedXML);
270
269
  });
271
270
  });
272
- describe('pColumns', () => {
273
- it('appends pColumns to sql XML', () => {
271
+ describe('pColumns', function () {
272
+ it('appends pColumns to sql XML', function () {
274
273
  // procedure columns:
275
274
  const sql = new iSql();
276
275
 
@@ -279,7 +278,7 @@ describe('iSql Class Unit Tests', () => {
279
278
  sql.pColumns(['', 'QSYS2', 'QCMDEXC', 'COMMAND']);
280
279
  expect(sql.toXML()).to.equal(expectedXML);
281
280
  });
282
- it('appends pColumns with error on to sql XML', () => {
281
+ it('appends pColumns with error on to sql XML', function () {
283
282
  // procedure columns:
284
283
  const sql = new iSql();
285
284
 
@@ -289,8 +288,8 @@ describe('iSql Class Unit Tests', () => {
289
288
  expect(sql.toXML()).to.equal(expectedXML);
290
289
  });
291
290
  });
292
- describe('primaryKeys', () => {
293
- it('appends primarykeys to sql XML', () => {
291
+ describe('primaryKeys', function () {
292
+ it('appends primarykeys to sql XML', function () {
294
293
  const sql = new iSql();
295
294
 
296
295
  const expectedXML = '<sql><primarykeys error=\'fast\'><parm></parm><parm>QUSRSYS</parm><parm>QASZRAIRX</parm></primarykeys></sql>';
@@ -298,7 +297,7 @@ describe('iSql Class Unit Tests', () => {
298
297
  sql.primaryKeys(['', 'QUSRSYS', 'QASZRAIRX']);
299
298
  expect(sql.toXML()).to.equal(expectedXML);
300
299
  });
301
- it('appends primarykeys with error on to sql XML', () => {
300
+ it('appends primarykeys with error on to sql XML', function () {
302
301
  const sql = new iSql();
303
302
 
304
303
  const expectedXML = '<sql><primarykeys error=\'on\'><parm></parm><parm>QUSRSYS</parm><parm>QASZRAIRX</parm></primarykeys></sql>';
@@ -307,8 +306,8 @@ describe('iSql Class Unit Tests', () => {
307
306
  expect(sql.toXML()).to.equal(expectedXML);
308
307
  });
309
308
  });
310
- describe('foreignKeys', () => {
311
- it('appends foreignkeys to sql XML', () => {
309
+ describe('foreignKeys', function () {
310
+ it('appends foreignkeys to sql XML', function () {
312
311
  const sql = new iSql();
313
312
 
314
313
  const expectedXML = '<sql><foreignkeys error=\'fast\'><parm></parm><parm>QUSRSYS</parm><parm>QASZRAIRC</parm><parm></parm><parm>QUSRSYS</parm><parm>QASZRAIRX</parm></foreignkeys></sql>';
@@ -318,7 +317,7 @@ describe('iSql Class Unit Tests', () => {
318
317
  sql.foreignKeys(['', 'QUSRSYS', 'QASZRAIRC', '', 'QUSRSYS', 'QASZRAIRX']);
319
318
  expect(sql.toXML()).to.equal(expectedXML);
320
319
  });
321
- it('appends foreignkeys with error on to sql XML', () => {
320
+ it('appends foreignkeys with error on to sql XML', function () {
322
321
  const sql = new iSql();
323
322
 
324
323
  const expectedXML = '<sql><foreignkeys error=\'on\'><parm></parm><parm>QUSRSYS</parm><parm>QASZRAIRC</parm><parm></parm><parm>QUSRSYS</parm><parm>QASZRAIRX</parm></foreignkeys></sql>';
@@ -329,8 +328,8 @@ describe('iSql Class Unit Tests', () => {
329
328
  expect(sql.toXML()).to.equal(expectedXML);
330
329
  });
331
330
  });
332
- describe('statistics', () => {
333
- it('appends statistics to sql XML', () => {
331
+ describe('statistics', function () {
332
+ it('appends statistics to sql XML', function () {
334
333
  const sql = new iSql();
335
334
 
336
335
  const expectedXML = '<sql><statistics error=\'fast\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm><parm>all</parm></statistics></sql>';
@@ -338,7 +337,7 @@ describe('iSql Class Unit Tests', () => {
338
337
  sql.statistics(['', 'QIWS', 'QCUSTCDT', 'all']);
339
338
  expect(sql.toXML()).to.equal(expectedXML);
340
339
  });
341
- it('appends statistics with error on to sql XML', () => {
340
+ it('appends statistics with error on to sql XML', function () {
342
341
  const sql = new iSql();
343
342
 
344
343
  const expectedXML = '<sql><statistics error=\'on\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm><parm>all</parm></statistics></sql>';
@@ -347,8 +346,8 @@ describe('iSql Class Unit Tests', () => {
347
346
  expect(sql.toXML()).to.equal(expectedXML);
348
347
  });
349
348
  });
350
- describe('special', () => {
351
- it('appends special to sql XML', () => {
349
+ describe('special', function () {
350
+ it('appends special to sql XML', function () {
352
351
  const sql = new iSql();
353
352
 
354
353
  const expectedXML = '<sql><special error=\'fast\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm><parm>row</parm><parm>no</parm></special></sql>';
@@ -356,7 +355,7 @@ describe('iSql Class Unit Tests', () => {
356
355
  sql.special(['', 'QIWS', 'QCUSTCDT', 'row', 'no']);
357
356
  expect(sql.toXML()).to.equal(expectedXML);
358
357
  });
359
- it('appends special with error on to sql XML', () => {
358
+ it('appends special with error on to sql XML', function () {
360
359
  const sql = new iSql();
361
360
 
362
361
  const expectedXML = '<sql><special error=\'on\'><parm></parm><parm>QIWS</parm><parm>QCUSTCDT</parm><parm>row</parm><parm>no</parm></special></sql>';
@@ -365,22 +364,22 @@ describe('iSql Class Unit Tests', () => {
365
364
  expect(sql.toXML()).to.equal(expectedXML);
366
365
  });
367
366
  });
368
- describe('count', () => {
369
- it('appends count to sql XML', () => {
367
+ describe('count', function () {
368
+ it('appends count to sql XML', function () {
370
369
  const sql = new iSql();
371
370
 
372
371
  const expectedXML = '<sql><count desc=\'both\' error=\'fast\'></count></sql>';
373
372
  sql.count({ desc: 'both' });
374
373
  expect(sql.toXML()).to.equal(expectedXML);
375
374
  });
376
- it('appends count without options object to sql XML', () => {
375
+ it('appends count without options object to sql XML', function () {
377
376
  const sql = new iSql();
378
377
 
379
378
  const expectedXML = '<sql><count desc=\'both\' error=\'fast\'></count></sql>';
380
379
  sql.count();
381
380
  expect(sql.toXML()).to.equal(expectedXML);
382
381
  });
383
- it('appends count with error on to sql XML', () => {
382
+ it('appends count with error on to sql XML', function () {
384
383
  const sql = new iSql();
385
384
 
386
385
  const expectedXML = '<sql><count desc=\'both\' error=\'on\'></count></sql>';
@@ -388,15 +387,15 @@ describe('iSql Class Unit Tests', () => {
388
387
  expect(sql.toXML()).to.equal(expectedXML);
389
388
  });
390
389
  });
391
- describe('rowCount', () => {
392
- it('appends rowcount to sql XML', () => {
390
+ describe('rowCount', function () {
391
+ it('appends rowcount to sql XML', function () {
393
392
  const sql = new iSql();
394
393
 
395
394
  const expectedXML = '<sql><rowcount error=\'fast\'></rowcount></sql>';
396
395
  sql.rowCount();
397
396
  expect(sql.toXML()).to.equal(expectedXML);
398
397
  });
399
- it('appends rowcount with error on to sql XML', () => {
398
+ it('appends rowcount with error on to sql XML', function () {
400
399
  const sql = new iSql();
401
400
 
402
401
  const expectedXML = '<sql><rowcount error=\'on\'></rowcount></sql>';
@@ -404,8 +403,8 @@ describe('iSql Class Unit Tests', () => {
404
403
  expect(sql.toXML()).to.equal(expectedXML);
405
404
  });
406
405
  });
407
- describe('free', () => {
408
- it('appends free to sql XML', () => {
406
+ describe('free', function () {
407
+ it('appends free to sql XML', function () {
409
408
  const sql = new iSql();
410
409
 
411
410
  const expectedXML = '<sql><free></free></sql>';
@@ -413,8 +412,8 @@ describe('iSql Class Unit Tests', () => {
413
412
  expect(sql.toXML()).to.equal(expectedXML);
414
413
  });
415
414
  });
416
- describe('describe', () => {
417
- it('appends describe to sql XML', () => {
415
+ describe('describe', function () {
416
+ it('appends describe to sql XML', function () {
418
417
  const sql = new iSql();
419
418
 
420
419
  const expectedXML = '<sql><describe desc=\'both\' error=\'fast\'></describe></sql>';
@@ -422,7 +421,7 @@ describe('iSql Class Unit Tests', () => {
422
421
  sql.describe({ desc: 'both' });
423
422
  expect(sql.toXML()).to.equal(expectedXML);
424
423
  });
425
- it('appends describe without options object to sql XML', () => {
424
+ it('appends describe without options object to sql XML', function () {
426
425
  const sql = new iSql();
427
426
 
428
427
  const expectedXML = '<sql><describe desc=\'both\' error=\'fast\'></describe></sql>';
@@ -430,7 +429,7 @@ describe('iSql Class Unit Tests', () => {
430
429
  sql.describe();
431
430
  expect(sql.toXML()).to.equal(expectedXML);
432
431
  });
433
- it('appends describe with error on to sql XML', () => {
432
+ it('appends describe with error on to sql XML', function () {
434
433
  const sql = new iSql();
435
434
 
436
435
  const expectedXML = '<sql><describe desc=\'both\' error=\'on\'></describe></sql>';
@@ -15,13 +15,11 @@
15
15
  // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
16
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
17
 
18
- /* eslint-env mocha */
19
-
20
18
  const { expect } = require('chai');
21
19
  const { xmlToJson } = require('../../../lib/itoolkit');
22
20
 
23
- describe('xmlToJson Tests', () => {
24
- it('converts CL command XML output to js object', () => {
21
+ describe('xmlToJson Tests', function () {
22
+ it('converts CL command XML output to js object', function () {
25
23
  const xmlOut = '<?xml version=\'1.0\'?><myscript><cmd exec=\'rexx\' error=\'fast\'>'
26
24
  + '<success>+++ success RTVJOBA USRLIBL(?) SYSLIBL(?)</success>'
27
25
  + '<row><data desc=\'USRLIBL\'>QGPL QTEMP QDEVELOP QBLDSYS'
@@ -45,7 +43,7 @@ describe('xmlToJson Tests', () => {
45
43
  expect(result[0].data[0]).to.haveOwnProperty('value').and.to.equal(value);
46
44
  });
47
45
 
48
- it('converts sh command XML output to js object', () => {
46
+ it('converts sh command XML output to js object', function () {
49
47
  const xmlOut = '<?xml version=\'1.0\'?><myscript><sh error=\'fast\'>\n'
50
48
  + 'bin\n'
51
49
  + 'ccs\n'
@@ -71,8 +69,7 @@ describe('xmlToJson Tests', () => {
71
69
  expect(result[0]).to.haveOwnProperty('data').and.to.equal(data);
72
70
  });
73
71
 
74
-
75
- it('converts qsh command XML output to js object', () => {
72
+ it('converts qsh command XML output to js object', function () {
76
73
  const xmlOut = '<?xml version=\'1.0\'?><myscript><qsh error=\'fast\'>\n'
77
74
  + 'bin\n'
78
75
  + 'ccs\n'
@@ -98,7 +95,7 @@ describe('xmlToJson Tests', () => {
98
95
  expect(result[0]).to.haveOwnProperty('data').and.to.equal(data);
99
96
  });
100
97
 
101
- it('converts pgm command XML output to js object', () => {
98
+ it('converts pgm command XML output to js object', function () {
102
99
  const xmlOut = `<?xml version='1.0'?><myscript><pgm name='QWCRSVAL' lib='QSYS' error='fast'>
103
100
  <parm io='out'>
104
101
  <ds len='rec1'>
@@ -152,7 +149,7 @@ describe('xmlToJson Tests', () => {
152
149
  });
153
150
  });
154
151
 
155
- it('converts sql command XML output to js object', () => {
152
+ it('converts sql command XML output to js object', function () {
156
153
  const xmlOut = `<?xml version='1.0'?><myscript><sql>
157
154
  <query error='fast' conn='conn1' stmt='stmt1'>
158
155
  <success><![CDATA[+++ success SELECT LSTNAM, STATE FROM QIWS.QCUSTCDT]]></success>