@@ -29,29 +29,18 @@ Object.defineProperty(globalThis, "WebSocket", {
2929describe ( "E2E: Client-Server Sync" , ( ) => {
3030 let server : SimpleServer ;
3131 let port : number ;
32- let skip = false ;
3332
3433 beforeAll ( async ( ) => {
35- try {
36- port = await getPort ( ) ;
37- server = new SimpleServer ( { port } ) ;
38- await server . start ( ) ;
39- } catch ( e ) {
40- skip = true ;
41- console . warn ( "Skipping e2e tests: cannot bind port" , e ) ;
42- }
34+ port = await getPort ( ) ;
35+ server = new SimpleServer ( { port } ) ;
36+ await server . start ( ) ;
4337 } ) ;
4438
4539 afterAll ( async ( ) => {
46- if ( ! skip && server ) {
47- await server . stop ( ) ;
48- }
40+ await server . stop ( ) ;
4941 } , 15000 ) ;
5042
5143 it ( "should sync two clients through server" , async ( ) => {
52- if ( skip ) return ;
53- // Create two clients
54- if ( skip ) return ;
5544 const client1 = new LoroWebsocketClient ( { url : `ws://localhost:${ port } ` } ) ;
5645 const client2 = new LoroWebsocketClient ( { url : `ws://localhost:${ port } ` } ) ;
5746
@@ -208,7 +197,6 @@ describe("E2E: Client-Server Sync", () => {
208197 } , 10000 ) ;
209198
210199 it ( "should resolve ping() with pong" , async ( ) => {
211- if ( skip ) return ;
212200 const client = new LoroWebsocketClient ( { url : `ws://localhost:${ port } ` } ) ;
213201 await client . waitConnected ( ) ;
214202
@@ -217,7 +205,6 @@ describe("E2E: Client-Server Sync", () => {
217205 } , 10000 ) ;
218206
219207 it ( "emits correct status transitions across reconnects and manual close/connect" , async ( ) => {
220- if ( skip ) return ;
221208 const client = new LoroWebsocketClient ( { url : `ws://localhost:${ port } ` } ) ;
222209
223210 const seen : string [ ] = [ ] ;
@@ -443,9 +430,9 @@ describe("E2E: Client-Server Sync", () => {
443430 await waitUntil (
444431 ( ) =>
445432 statuses1 . filter ( s => s === ClientStatus . Connected ) . length >
446- initialConnected1 &&
433+ initialConnected1 &&
447434 statuses2 . filter ( s => s === ClientStatus . Connected ) . length >
448- initialConnected2 ,
435+ initialConnected2 ,
449436 5000 ,
450437 25
451438 ) ;
@@ -658,7 +645,7 @@ describe("E2E: Client-Server Sync", () => {
658645 setTimeout ( ( ) => {
659646 try {
660647 ws . close ( 1008 , "policy" ) ;
661- } catch { }
648+ } catch { }
662649 } , 30 ) ;
663650 }
664651 } ) ;
@@ -993,7 +980,7 @@ describe("E2E: RoomError rejoin policy", () => {
993980 const adaptor = new LoroAdaptor ( ) ;
994981 await client . join ( { roomId : "room-rejoin" , crdtAdaptor : adaptor } ) ;
995982
996- await waitUntil ( ( ) => joinCount >= 2 , 5000 , 20 ) . catch ( ( ) => { } ) ;
983+ await waitUntil ( ( ) => joinCount >= 2 , 5000 , 20 ) . catch ( ( ) => { } ) ;
997984 // Ensure no extra rejoins
998985 await new Promise ( r => setTimeout ( r , 200 ) ) ;
999986 expect ( joinCount ) . toBe ( 2 ) ;
0 commit comments