Skip to content

Commit 5cb61f6

Browse files
committed
Update tests
1 parent a61d1d0 commit 5cb61f6

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

example/lifecycle-node-example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class App {
8888
onActivate() {
8989
console.log('Lifecycle: ACTIVATE');
9090
this._publisher.activate();
91-
this._timer = this._node.createTimer(BigInt(1000000), () => {
91+
this._timer = this._node.createTimer(BigInt('1000000000'), () => {
9292
this._publisher.publish(`${this._count--}`);
9393
});
9494
return rclnodejs.lifecycle.CallbackReturnCode.SUCCESS;

test/test-security-related.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ describe('Fuzzing API calls testing', function () {
232232
var node = rclnodejs.createNode('node3', '/inconsistent');
233233
const invalidParams = [
234234
['100', () => {}],
235-
[BigInt(100), null],
235+
[BigInt('100000000'), null],
236236
];
237237
invalidParams.forEach((param) => {
238238
assertThrowsError(

test/test-timer.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
const assert = require('assert');
1818
const rclnodejs = require('../index.js');
1919

20-
const TIMER_INTERVAL = '100000000';
20+
const TIMER_INTERVAL = BigInt('100000000');
2121
describe('rclnodejs Timer class testing', function () {
2222
this.timeout(60 * 1000);
2323

@@ -33,7 +33,7 @@ describe('rclnodejs Timer class testing', function () {
3333
it('node.createTimer', function (done) {
3434
var times = 0;
3535
var node = rclnodejs.createNode('timer');
36-
var timer = node.createTimer(BigInt(TIMER_INTERVAL), function () {
36+
var timer = node.createTimer(TIMER_INTERVAL, function () {
3737
times += 1;
3838
timer.cancel();
3939
node.destroy();
@@ -55,7 +55,7 @@ describe('rclnodejs Timer class testing', function () {
5555
});
5656

5757
it('timer.period should be readonly', function (done) {
58-
var timer = node.createTimer(BigInt(TIMER_INTERVAL), function () {
58+
var timer = node.createTimer(TIMER_INTERVAL, function () {
5959
assert.deepEqual(timer.period, TIMER_INTERVAL);
6060
assert.throws(
6161
() => {
@@ -79,7 +79,7 @@ describe('rclnodejs Timer class testing', function () {
7979
});
8080

8181
it('timer.cancel', function (done) {
82-
var timer = node.createTimer(BigInt(TIMER_INTERVAL), function () {
82+
var timer = node.createTimer(TIMER_INTERVAL, function () {
8383
timer.cancel();
8484
assert.ok(timer.isCanceled());
8585
done();
@@ -88,7 +88,7 @@ describe('rclnodejs Timer class testing', function () {
8888
});
8989

9090
it('timer.isCanceled', function (done) {
91-
var timer = node.createTimer(BigInt(TIMER_INTERVAL), function () {
91+
var timer = node.createTimer(TIMER_INTERVAL, function () {
9292
assert.ok(!timer.isCanceled());
9393
timer.cancel();
9494
assert.ok(timer.isCanceled());
@@ -98,7 +98,7 @@ describe('rclnodejs Timer class testing', function () {
9898
});
9999

100100
it('timer.isReady', function (done) {
101-
var timer = node.createTimer(BigInt(TIMER_INTERVAL), function () {
101+
var timer = node.createTimer(TIMER_INTERVAL, function () {
102102
assert.ok(!timer.isReady());
103103
timer.cancel();
104104
done();
@@ -107,7 +107,7 @@ describe('rclnodejs Timer class testing', function () {
107107
});
108108

109109
it('timer.reset', function (done) {
110-
var timer = node.createTimer(BigInt(TIMER_INTERVAL), function () {
110+
var timer = node.createTimer(TIMER_INTERVAL, function () {
111111
timer.cancel();
112112
done();
113113
});
@@ -119,7 +119,7 @@ describe('rclnodejs Timer class testing', function () {
119119
});
120120

121121
it('timer.timeSinceLastCall', function (done) {
122-
var timer = node.createTimer(BigInt(TIMER_INTERVAL), function () {
122+
var timer = node.createTimer(TIMER_INTERVAL, function () {
123123
assert.deepStrictEqual(typeof timer.timeSinceLastCall(), 'bigint');
124124
timer.cancel();
125125
done();
@@ -128,7 +128,7 @@ describe('rclnodejs Timer class testing', function () {
128128
});
129129

130130
it('timer.timeUntilNextCall', function (done) {
131-
var timer = node.createTimer(BigInt(TIMER_INTERVAL), function () {
131+
var timer = node.createTimer(TIMER_INTERVAL, function () {
132132
var nextCallInterval = timer.timeUntilNextCall();
133133
assert.deepStrictEqual(typeof nextCallInterval, 'bigint');
134134
assert.ok(nextCallInterval <= TIMER_INTERVAL);

0 commit comments

Comments
 (0)