diff --git a/wrappers/nodejs/test/test-align.js b/wrappers/nodejs/test/test-align.js index 6566d31c8e..22d20f1842 100644 --- a/wrappers/nodejs/test/test-align.js +++ b/wrappers/nodejs/test/test-align.js @@ -64,14 +64,14 @@ describe('Align test', function() { }); }); - it.skip('Testing process - invalid argument', () => { + it('Testing process - invalid argument', () => { const align = new rs2.Align(rs2.stream.STREAM_COLOR); assert.throws(() => { align.process('dummy'); }); }); - it.skip('Testing process - valid argument', () => { + it('Testing process - valid argument', () => { const align = new rs2.Align(rs2.stream.STREAM_COLOR); assert.doesNotThrow(() => { align.process(frameset); diff --git a/wrappers/nodejs/test/test-config.js b/wrappers/nodejs/test/test-config.js index 0d8e47b0d3..f66573b77b 100644 --- a/wrappers/nodejs/test/test-config.js +++ b/wrappers/nodejs/test/test-config.js @@ -39,7 +39,7 @@ describe('Config test', function() { }); it('Testing method canResolve - 2 argument', () => { - assert.doesNotThrow(() => { + assert.throws(() => { config.canResolve(pipeline, pipeline); }); }); @@ -96,7 +96,7 @@ describe('Config test', function() { }); it('Testing method enableDevice - 0 argument', () => { - assert.doesNotThrow(() => { + assert.throws(() => { config.enableDevice(); }); }); diff --git a/wrappers/nodejs/test/test-context.js b/wrappers/nodejs/test/test-context.js index 0ad25f45ec..e9b701e859 100644 --- a/wrappers/nodejs/test/test-context.js +++ b/wrappers/nodejs/test/test-context.js @@ -146,7 +146,7 @@ describe('Context test', function() { it('testing method - setDevicesChangedCallback', () => { const context = new librealsense2.Context(); - assert.doesNotThrow(() => { + assert.throws(() => { context.setDevicesChangedCallback(); }); }); diff --git a/wrappers/nodejs/test/test-devicehub.js b/wrappers/nodejs/test/test-devicehub.js index 5fa7dc5354..6287c60e71 100644 --- a/wrappers/nodejs/test/test-devicehub.js +++ b/wrappers/nodejs/test/test-devicehub.js @@ -55,7 +55,7 @@ describe('DeviceHub test', function() { }); }); - it.skip('Testing method isConnected - with invalid argument', () => { + it('Testing method isConnected - with invalid argument', () => { assert.throws(() => { devh.isConnected('dummy'); }); diff --git a/wrappers/nodejs/test/test-devicelist.js b/wrappers/nodejs/test/test-devicelist.js index 4b8980e085..4a1b9f19a2 100644 --- a/wrappers/nodejs/test/test-devicelist.js +++ b/wrappers/nodejs/test/test-devicelist.js @@ -54,8 +54,9 @@ describe('DeviceList test', function() { }); it('Testing method getDevice - without argument', () => { - let dev = devl.getDevice(); - assert(dev instanceof rs2.Device); + assert.throws(() => { + devl.getDevice(); + }); }); it('Testing method getDevice - return value', () => { @@ -78,8 +79,9 @@ describe('DeviceList test', function() { }); it('Testing method getDevice - with invalid argument', () => { - let dev = devl.getDevice('dummy'); - assert(dev instanceof rs2.Device); + assert.throws(() => { + devl.getDevice('dummy'); + }); }); it('Testing method contains - without argument', () => { diff --git a/wrappers/nodejs/test/test-playbackdevice.js b/wrappers/nodejs/test/test-playbackdevice.js index 63097b8fd4..15882d1232 100644 --- a/wrappers/nodejs/test/test-playbackdevice.js +++ b/wrappers/nodejs/test/test-playbackdevice.js @@ -117,7 +117,7 @@ describe('PlayBackDevice test', function() { it('Testing constructor - 2 arguments', () => { let ctx = new rs2.Context(); - assert.doesNotThrow(() => { + assert.throws(() => { ctx.loadDevice(fileName, 1); }); }); @@ -129,7 +129,7 @@ describe('PlayBackDevice test', function() { }); }); - it.skip('Testing constructor - invalid file content', () => { + it('Testing constructor - invalid file content', () => { let ctx = new rs2.Context(); assert.throws(() => { ctx.loadDevice('./test-playbackdevice.js'); diff --git a/wrappers/nodejs/test/test-sensor.js b/wrappers/nodejs/test/test-sensor.js index f38ded787b..0bff75a918 100644 --- a/wrappers/nodejs/test/test-sensor.js +++ b/wrappers/nodejs/test/test-sensor.js @@ -26,12 +26,9 @@ describe('Sensor test', function() { rs2.cleanup(); }); - const optionsTestArray = [ - rs2.option.option_enable_auto_exposure, - 'enable_auto_exposure', - rs2.option.OPTION_ENABLE_AUTO_WHITE_BALANCE, - ]; - + const optionsTestArray = Object.values(rs2.option); + optionsTestArray.pop(); + optionsTestArray.pop(); it('Testing member - isValid', () => { sensors.forEach((sensor) => { assert.equal(typeof sensor.isValid, 'boolean'); @@ -197,7 +194,7 @@ describe('Sensor test', function() { } }); }); - }).timeout(20 * 1000); + }).timeout(30 * 1000); it('Testing method getOptionDescription', () => { sensors.forEach((sensor) => { @@ -212,9 +209,15 @@ describe('Sensor test', function() { it('Testing method getOptionValueDescription', () => { sensors.forEach((sensor) => { optionsTestArray.forEach((o) => { - assert(typeof sensor.getOptionValueDescription(o) === 'string' || - typeof sensor.getOptionValueDescription(o) === 'undefined' - ); + let value; + if (sensor.supportsOption(o)) { + value = sensor.getOption(o); + } else { + value = 0; + } + assert(typeof sensor.getOptionValueDescription(o, value) === 'undefined' || + typeof sensor.getOptionValueDescription(o, value) === 'string' + ); }); }); }); @@ -293,7 +296,7 @@ describe('Sensor test', function() { it('Testing method setNotificationsCallback', () => { sensors.forEach((sensor) => { - assert.doesNotThrow(() => { + assert.throws(() => { sensor.setNotificationsCallback(); }); }); diff --git a/wrappers/nodejs/test/test-streamprofile.js b/wrappers/nodejs/test/test-streamprofile.js index 1394bd3be1..d90cdbe0e6 100644 --- a/wrappers/nodejs/test/test-streamprofile.js +++ b/wrappers/nodejs/test/test-streamprofile.js @@ -93,7 +93,7 @@ describe('StreamProfile test', function() { assert.equal(Object.prototype.toString.call(ExtrinsicsObject.rotation), '[object Array]'); }); - it.skip('Testing mothod getExtrinsicsTo - invalid argument', () => { + it('Testing mothod getExtrinsicsTo - invalid argument', () => { assert.throws(() => { streamProfiles[0].getExtrinsicsTo('dummy'); }); diff --git a/wrappers/nodejs/test/test-videostreamprofile.js b/wrappers/nodejs/test/test-videostreamprofile.js index c6ffa97081..1d8b91be24 100644 --- a/wrappers/nodejs/test/test-videostreamprofile.js +++ b/wrappers/nodejs/test/test-videostreamprofile.js @@ -105,7 +105,7 @@ describe('VideoStreamProfile test', function() { assert.equal(Object.prototype.toString.call(ExtrinsicsObject.rotation), '[object Array]'); }); - it.skip('Testing method getExtrinsicsTo - invalid argument', () => { + it('Testing method getExtrinsicsTo - invalid argument', () => { assert.throws(() => { streamProfiles[0].getExtrinsicsTo('dummy'); });