@@ -20,6 +20,12 @@ server.on('connect', function(node) {
2020 serverClient = node ;
2121} )
2222
23+ test ( 'Before onsubscribe is defined' , function ( t ) {
24+ client . subscribe ( 'DATA' ) . catch ( function ( err ) {
25+ t . equal ( err , dopClient . core . error . reject . OBJECT_NOT_FOUND , 'Object not found' ) ;
26+ t . end ( )
27+ } )
28+ } )
2329
2430
2531test ( 'Client subscribe synchronously' , function ( t ) {
@@ -73,8 +79,8 @@ test('Client subscribe synchronously', function(t) {
7379 else if ( name === 'REJECT' ) {
7480 req . reject ( { message :'Subscription rejected' } )
7581 }
76- else if ( name === 'NOOBJECT ' ) {
77- req . resolve ( 'NOOBJECT ' ) ;
82+ else if ( name === 'RESOLVESTRING ' ) {
83+ req . resolve ( 'RESOLVESTRING ' ) ;
7884 setTimeout ( t . end . bind ( t ) , 10 ) ;
7985 }
8086 } )
@@ -122,7 +128,11 @@ test('Client subscribe synchronously', function(t) {
122128 } )
123129 . catch ( function ( err ) {
124130 t . equal ( err . message , 'Subscription rejected' , 'Subscription rejected' ) ;
125- return client . subscribe ( 'NOOBJECT' ) ;
131+ return client . subscribe ( ) ;
132+ } )
133+ . catch ( function ( err ) {
134+ t . equal ( err , dopClient . core . error . reject . OBJECT_NOT_FOUND , 'Object not found' ) ;
135+ return client . subscribe ( 'RESOLVESTRING' ) ;
126136 } )
127137 // .catch(function(err){
128138 // console.log( 123131, typeof err );
0 commit comments