Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions test/test-type-description-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ const TypeDescriptionService = require('../lib/type_description_service.js');

describe('type description service test suite', function () {
this.timeout(60 * 1000);
let node;

beforeEach(function () {
return rclnodejs.init();
beforeEach(async function () {
await rclnodejs.init();
const nodeName = 'test_type_description_service';
node = rclnodejs.createNode(nodeName);
rclnodejs.spin(node);
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the test node created in beforeEach is properly shut down or cleaned up in afterEach to prevent potential resource leaks or interference between tests.

Copilot uses AI. Check for mistakes.

});

afterEach(function () {
Expand All @@ -35,9 +39,7 @@ describe('type description service test suite', function () {
this.skip();
return;
}
// Create a node and a publisher
const nodeName = 'test_type_description_service';
const node = rclnodejs.createNode(nodeName);
// Create a publisher
const topic = 'test_get_type_description_publisher';
const topicType = 'std_msgs/msg/String';
node.createPublisher(topicType, topic);
Expand Down Expand Up @@ -66,6 +68,5 @@ describe('type description service test suite', function () {
assert.notStrictEqual(response.type_sources.length, 0);
done();
});
rclnodejs.spin(node);
});
});
Loading