Skip to content

Commit e8214df

Browse files
committed
Add a negative soda metaData test
1 parent 80bb1aa commit e8214df

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

test/list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4175,6 +4175,7 @@ Overview of node-oracledb functional tests
41754175
164.9 get multiple documents
41764176
164.10 create index
41774177
164.11 the examples/soda1.js case
4178+
164.12 Negative: create collection with invalid metaData value
41784179

41794180
165. soda2.js
41804181
165.1 create two sodaDatabase objects which point to the same instance

test/soda1.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,4 +476,32 @@ describe('164. soda1.js', () => {
476476
}
477477
}); // 164.11
478478

479+
it('164.12 Negative: create collection with invalid metaData value', async () => {
480+
let conn;
481+
try {
482+
conn = await oracledb.getConnection(dbconfig);
483+
let sd = conn.getSodaDatabase();
484+
485+
let t_collname = "soda_test_164_5";
486+
let options = { metaData: "metaData" };
487+
let coll = await sd.createCollection(t_collname, options);
488+
should.not.exist(coll);
489+
490+
} catch(err) {
491+
should.exist(err);
492+
should.strictEqual(
493+
err.message,
494+
'NJS-006: invalid type for parameter 3'
495+
);
496+
} finally {
497+
if (conn) {
498+
try {
499+
await conn.close();
500+
} catch(err) {
501+
should.not.exist(err);
502+
}
503+
}
504+
}
505+
}); // 164.12
506+
479507
});

0 commit comments

Comments
 (0)