@@ -11,7 +11,7 @@ require('@pryv/socket.io')(pryv);
1111let conn = null ;
1212const testStreamId = 'socket-test' ;
1313
14- describe ( 'Socket.IO' , function ( ) {
14+ describe ( '[SKIX] Socket.IO' , function ( ) {
1515 this . timeout ( 20000 ) ;
1616 let apiEndpoint ;
1717 let apiEndpointBogusToken ;
@@ -40,8 +40,8 @@ describe('Socket.IO', function () {
4040 expect ( res [ 0 ] . error . id ) . to . equal ( 'item-already-exists' ) ;
4141 } ) ;
4242
43- describe ( 'init on invalid endpoint' , ( ) => {
44- it ( 'Should throw an error "Not Found" or ENOTFOUND when user is not known' , async ( ) => {
43+ describe ( '[SIEX] init on invalid endpoint' , ( ) => {
44+ it ( '[SIEA] Should throw an error "Not Found" or ENOTFOUND when user is not known' , async ( ) => {
4545 conn = new pryv . Connection ( apiEndpointBogusUsername ) ;
4646 try {
4747 await conn . socket . open ( ) ;
@@ -58,7 +58,7 @@ describe('Socket.IO', function () {
5858 throw new Error ( 'Should throw an error' ) ;
5959 } ) ;
6060
61- it ( 'Should throw an error "Unauthorized" when token is invalid' , async ( ) => {
61+ it ( '[SIEB] Should throw an error "Unauthorized" when token is invalid' , async ( ) => {
6262 conn = new pryv . Connection ( apiEndpointBogusToken ) ;
6363 try {
6464 await conn . socket . open ( ) ;
@@ -69,7 +69,7 @@ describe('Socket.IO', function () {
6969 } ) ;
7070 } ) ;
7171
72- describe ( 'init on valid endpoint' , ( ) => {
72+ describe ( '[SIVX] init on valid endpoint' , ( ) => {
7373 beforeEach ( async ( ) => {
7474 conn = new pryv . Connection ( apiEndpoint ) ;
7575 } ) ;
@@ -78,7 +78,7 @@ describe('Socket.IO', function () {
7878 conn = null ;
7979 } ) ;
8080
81- it ( 'Should throw an error if conn.socket.api() is called before being open()' , async ( ) => {
81+ it ( '[SIVA] Should throw an error if conn.socket.api() is called before being open()' , async ( ) => {
8282 try {
8383 await conn . socket . api ( [ { method : 'events.get' , params : { } } ] ) ;
8484 } catch ( e ) {
@@ -87,7 +87,7 @@ describe('Socket.IO', function () {
8787 throw new Error ( 'Should throw an error' ) ;
8888 } ) ;
8989
90- it ( 'Should throw an error if conn.socket.on() is called before being open()' , async ( ) => {
90+ it ( '[SIVB] Should throw an error if conn.socket.on() is called before being open()' , async ( ) => {
9191 try {
9292 await conn . socket . on ( 'eventsChanged' ) ;
9393 } catch ( e ) {
@@ -96,13 +96,13 @@ describe('Socket.IO', function () {
9696 throw new Error ( 'Should throw an error' ) ;
9797 } ) ;
9898
99- it ( 'Correct initialization should return socket instance' , async ( ) => {
99+ it ( '[SIVC] Correct initialization should return socket instance' , async ( ) => {
100100 const socket = await conn . socket . open ( ) ;
101101 expect ( socket . _io ) . to . exist ;
102102 } ) ;
103103 } ) ;
104104
105- describe ( 'socket.api' , ( ) => {
105+ describe ( '[SAPX] socket.api' , ( ) => {
106106 before ( async ( ) => {
107107 conn = new pryv . Connection ( apiEndpoint ) ;
108108 await conn . socket . open ( ) ;
@@ -112,7 +112,7 @@ describe('Socket.IO', function () {
112112 conn = null ;
113113 } ) ;
114114
115- it ( 'Handle correctly batch calls' , async ( ) => {
115+ it ( '[SAPA] Handle correctly batch calls' , async ( ) => {
116116 const res = await conn . socket . api ( [ { method : 'streams.get' , params : { } } ] ) ;
117117 expect ( res [ 0 ] ) . to . exist ;
118118 expect ( res [ 0 ] . streams ) . to . exist ;
@@ -121,7 +121,7 @@ describe('Socket.IO', function () {
121121 // we don't test further .api() as it relies on the implementation of pryv.Connection
122122 } ) ;
123123
124- describe ( 'notification' , ( ) => {
124+ describe ( '[SNTX] notification' , ( ) => {
125125 before ( async ( ) => {
126126 conn = new pryv . Connection ( apiEndpoint ) ;
127127 await conn . socket . open ( ) ;
@@ -131,7 +131,7 @@ describe('Socket.IO', function () {
131131 conn = null ;
132132 } ) ;
133133
134- it ( 'Fails on requesting an invalid notifcation' , async ( ) => {
134+ it ( '[SNTA] Fails on requesting an invalid notifcation' , async ( ) => {
135135 try {
136136 conn . socket . on ( 'Bogus' , ( ) => { } ) ;
137137 } catch ( e ) {
@@ -140,15 +140,15 @@ describe('Socket.IO', function () {
140140 throw new Error ( 'Should fail' ) ;
141141 } ) ;
142142
143- it ( 'Catches eventChanges' , ( done ) => {
143+ it ( '[SNTB] Catches eventChanges' , ( done ) => {
144144 function onEventChanged ( ) {
145145 return done ( ) ;
146146 }
147147 conn . socket . on ( 'eventsChanged' , onEventChanged ) ;
148148 conn . api ( [ { method : 'events.create' , params : { type : 'note/txt' , streamId : testStreamId , content : 'hello' } } ] ) ;
149149 } ) ;
150150
151- it ( 'Catches streamChanges' , ( done ) => {
151+ it ( '[SNTC] Catches streamChanges' , ( done ) => {
152152 function onStreamChange ( ) {
153153 return done ( ) ;
154154 }
@@ -157,7 +157,7 @@ describe('Socket.IO', function () {
157157 } ) ;
158158
159159 /** Keep this test the last on of this sequence */
160- it ( 'Catches disconnect' , ( done ) => {
160+ it ( '[SNTD] Catches disconnect' , ( done ) => {
161161 function onDisconnect ( reason ) {
162162 expect ( reason ) . to . equal ( 'io client disconnect' ) ;
163163 return done ( ) ;
0 commit comments