@@ -124,7 +124,7 @@ describe('172. executeMany2.js', function() {
124
124
}
125
125
} ) ;
126
126
127
- it ( '172.2.1 binding by position and by name cannot be mixed' , async ( ) => {
127
+ it ( '172.2.1 Negative - Binding by position and by name cannot be mixed' , async ( ) => {
128
128
let conn ;
129
129
try {
130
130
conn = await oracledb . getConnection ( dbconfig ) ;
@@ -155,7 +155,7 @@ describe('172. executeMany2.js', function() {
155
155
}
156
156
} ) ;
157
157
158
- it ( '172.2.2 Binding an array which values are undefined will throw ORA-01008' , async function ( ) {
158
+ it ( '172.2.2 Negative - Binding an array which values are undefined will throw ORA-01008' , async function ( ) {
159
159
let conn ;
160
160
try {
161
161
conn = await oracledb . getConnection ( dbconfig ) ;
@@ -181,7 +181,7 @@ describe('172. executeMany2.js', function() {
181
181
}
182
182
} ) ;
183
183
184
- it ( '172.2.3 Binding an array starts with undefined will throw ORA-01008' , async function ( ) {
184
+ it ( '172.2.3 Negative - Binding an array starts with undefined will throw ORA-01008' , async function ( ) {
185
185
let conn ;
186
186
try {
187
187
conn = await oracledb . getConnection ( dbconfig ) ;
@@ -212,7 +212,7 @@ describe('172. executeMany2.js', function() {
212
212
}
213
213
} ) ;
214
214
215
- it ( '172.2.4 Binding an array contains undefined will throw JS TypeError' , async function ( ) {
215
+ it ( '172.2.4 Negative - Binding an array contains undefined will throw JS TypeError' , async function ( ) {
216
216
let conn ;
217
217
try {
218
218
conn = await oracledb . getConnection ( dbconfig ) ;
@@ -241,6 +241,49 @@ describe('172. executeMany2.js', function() {
241
241
}
242
242
}
243
243
}
244
- } ) ;
245
- } ) ;
246
- } ) ;
244
+ } ) ; // 172.2.4
245
+
246
+ it ( '172.2.5 Negative - Bind an empty array' , async ( ) => {
247
+ try {
248
+ let conn = await oracledb . getConnection ( dbconfig ) ;
249
+
250
+ await testsUtil . assertThrowsAsync (
251
+ async ( ) => {
252
+ await conn . executeMany (
253
+ "insert into nodb_tab_emp values (:a, :b)" ,
254
+ [ ]
255
+ ) ;
256
+ } ,
257
+ / N J S - 0 0 5 /
258
+ ) ;
259
+ // NJS-005: invalid value for parameter 2
260
+
261
+ await conn . close ( ) ;
262
+ } catch ( err ) {
263
+ should . not . exist ( err ) ;
264
+ }
265
+ } ) ; // 172.2.5
266
+
267
+ it ( '172.2.6 Negative - Set number of ierations to 0' , async ( ) => {
268
+ try {
269
+ let conn = await oracledb . getConnection ( dbconfig ) ;
270
+
271
+ await testsUtil . assertThrowsAsync (
272
+ async ( ) => {
273
+ await conn . executeMany (
274
+ "insert into nodb_tab_emp values (:a, :b)" ,
275
+ 0
276
+ ) ;
277
+ } ,
278
+ / N J S - 0 0 5 /
279
+ ) ;
280
+ // NJS-005: invalid value for parameter 2
281
+
282
+ await conn . close ( ) ;
283
+ } catch ( err ) {
284
+ should . not . exist ( err ) ;
285
+ }
286
+ } ) ; // 172.2.6
287
+
288
+ } ) ; // 172.2
289
+ } ) ;
0 commit comments