@@ -22,6 +22,18 @@ const assertThrowsError = assertUtils.assertThrowsError;
2222
2323describe ( 'rclnodejs module existance testing' , function ( ) {
2424 describe ( 'rclnodejs module members' , function ( ) {
25+ it ( 'QoS member should exist' , function ( ) {
26+ assertMember ( 'QoS' , rclnodejs , rclnodejs . QoS , 'function' ) ;
27+ } ) ;
28+
29+ it ( 'validator member should exist' , function ( ) {
30+ assertMember ( 'validator' , rclnodejs , rclnodejs . validator , 'object' ) ;
31+ } ) ;
32+
33+ it ( 'createMessageObject method should exist' , function ( ) {
34+ assertMember ( 'createMessageObject' , rclnodejs , rclnodejs . createMessageObject , 'function' ) ;
35+ } ) ;
36+
2537 it ( 'createNode method should exist' , function ( ) {
2638 assertMember ( 'createNode' , rclnodejs , rclnodejs . createNode , 'function' ) ;
2739 } ) ;
@@ -142,29 +154,65 @@ describe('rclnodejs class existance testing', function() {
142154
143155 it ( 'destroyTimer method should exist' , function ( ) {
144156 assertMember ( 'destroyTimer' , node , node . destroyTimer , 'function' ) ;
145- } ) ;
157+ } ) ;
158+
159+ it ( 'name method should exist' , function ( ) {
160+ assertMember ( 'name' , node , node . name , 'function' ) ;
161+ } ) ;
162+
163+ it ( 'namespace method should exist' , function ( ) {
164+ assertMember ( 'namespace' , node , node . namespace , 'function' ) ;
165+ } ) ;
146166 } ) ;
147167
148- describe ( 'Publisher class' , function ( ) {
149- var node , RclString , publisher ;
168+ describe ( 'Publisher & Subscription class' , function ( ) {
169+ var node , RclString , publisher , subscription ;
150170
151171 before ( function ( ) {
152172 node = rclnodejs . createNode ( 'Publisher' ) ;
153173 RclString = 'std_msgs/msg/String' ;
154174 publisher = node . createPublisher ( RclString , 'chatter' ) ;
175+ subscription = node . createSubscription ( RclString , 'chatter' , ( ) => { } ) ;
155176 } ) ;
156177
157178 after ( function ( ) {
158179 node . destroy ( ) ;
159180 } ) ;
160181
161- it ( 'topic property should exist' , function ( ) {
182+ it ( 'topic property of a publisher should exist' , function ( ) {
162183 assertMember ( 'topic' , publisher , publisher . topic , 'string' ) ;
163184 } ) ;
164185
165- it ( 'publish method should exist' , function ( ) {
186+ it ( 'publish method of a publisher should exist' , function ( ) {
166187 assertMember ( 'publish' , publisher , publisher . publish , 'function' ) ;
167188 } ) ;
189+
190+ it ( 'topic member of a subscription should exist' , function ( ) {
191+ assertMember ( 'topic' , subscription , subscription . topic , 'string' ) ;
192+ } ) ;
193+ } ) ;
194+
195+ describe ( 'Client & Service class' , function ( ) {
196+ var node , AddTwoInts , client , service ;
197+
198+ before ( function ( ) {
199+ node = rclnodejs . createNode ( 'Client' ) ;
200+ AddTwoInts = 'example_interfaces/srv/AddTwoInts' ;
201+ client = node . createClient ( AddTwoInts , 'add_two_ints' , ( req , res ) => { } ) ;
202+ service = node . createService ( AddTwoInts , 'add_two_ints' , ( req ) => { } ) ;
203+ } ) ;
204+
205+ after ( function ( ) {
206+ node . destroy ( ) ;
207+ } ) ;
208+
209+ it ( 'serviceName member of a client should exist' , function ( ) {
210+ assertMember ( 'serviceName' , client , client . serviceName , 'string' ) ;
211+ } ) ;
212+
213+ it ( 'serviceName member of a service should exist' , function ( ) {
214+ assertMember ( 'serviceName' , service , service . serviceName , 'string' ) ;
215+ } ) ;
168216 } ) ;
169217
170218 describe ( 'Timer class' , function ( ) {
@@ -200,7 +248,7 @@ describe('rclnodejs class existance testing', function() {
200248 it ( 'reset method should exist' , function ( ) {
201249 assertMember ( 'reset' , timer , timer . reset , 'function' ) ;
202250 } ) ;
203-
251+
204252 it ( 'timeSinceLastCall method should exist' , function ( ) {
205253 assertMember ( 'timeSinceLastCall' , timer , timer . timeSinceLastCall , 'function' ) ;
206254 } ) ;
0 commit comments