Skip to content

Commit 736fff6

Browse files
committed
Fix for test failures.
1 parent 8c3185b commit 736fff6

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

test-basic/fromDocDescriptors-test.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const testlib = require("../etc/test-lib");
99
const db = marklogic.createDatabaseClient(testconfig.restAdminConnection);
1010
const op = marklogic.planBuilder;
1111
let serverConfiguration = {};
12+
const assert = require('assert');
1213
describe('optic-update fromDocDescriptors tests', function() {
1314
this.timeout(10000);
1415
before(function (done) {
@@ -128,12 +129,16 @@ describe('optic-update fromDocDescriptors tests', function() {
128129
});
129130

130131
it('test with wrong type of argument', function (done) {
131-
try {
132-
db.rows.query(op.fromDocDescriptors('asd'))
133-
} catch (e) {
134-
e.toString().includes('Error: doc-descriptor argument at 0 of PlanBuilder.fromDocDescriptors() must be a PlanDocDescriptor value');
135-
done();
136-
}
132+
db.rows.query(op.fromDocDescriptors('asd'))
133+
.catch(error => {
134+
try{
135+
assert(error.body.errorResponse.message.toString()
136+
.includes('Invalid arguments: fromDocDescriptors - expects an array/sequence or object as input.'))
137+
done();
138+
} catch(error){
139+
done(error);
140+
}
141+
})
137142
});
138143

139144
it('test with one doc descriptor', function (done) {

test-complete/nodejs-optic-nodes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('Nodejs Optic nodes json constructor test', function () {
9090
expect(output.rows[3]['myItem.rowId']).to.equal(4);
9191
expect(output.rows[3].xml).to.equal('<root attrA="4"><elemA>red</elemA><!--this is a comment for hoop--><elemB>hoop</elemB></root>');
9292
done();
93-
}, done);
93+
}).catch(error => done(error));
9494
});
9595

9696
it('TEST 2 - construct json from views', function (done) {

0 commit comments

Comments
 (0)