@@ -130,25 +130,6 @@ describe("Connections E2E Tests", () => {
130130 } ) ;
131131
132132 describe ( "Error Handling E2E" , ( ) => {
133- it (
134- "should handle invalid time units gracefully" ,
135- { timeout : 30000 } ,
136- async ( ) => {
137- setupTestFailureHandler ( "should handle invalid time units gracefully" ) ;
138-
139- const result = await runCommand (
140- [ "connections" , "stats" , "--unit" , "invalid" ] ,
141- {
142- timeoutMs : 30000 ,
143- env : { ABLY_CLI_TEST_MODE : "false" } ,
144- } ,
145- ) ;
146-
147- expect ( result . exitCode ) . not . toBe ( 0 ) ;
148- expect ( result . stderr ) . toContain ( "Expected --unit=" ) ;
149- } ,
150- ) ;
151-
152133 it (
153134 "should handle invalid transport types gracefully" ,
154135 { timeout : 30000 } ,
@@ -169,114 +150,6 @@ describe("Connections E2E Tests", () => {
169150 expect ( result . stderr ) . toContain ( "Expected --transport=" ) ;
170151 } ,
171152 ) ;
172-
173- it (
174- "should handle invalid timestamp formats gracefully" ,
175- { timeout : 30000 } ,
176- async ( ) => {
177- setupTestFailureHandler (
178- "should handle invalid timestamp formats gracefully" ,
179- ) ;
180-
181- const result = await runCommand (
182- [ "connections" , "stats" , "--start" , "not-a-timestamp" ] ,
183- {
184- timeoutMs : 30000 ,
185- env : { ABLY_CLI_TEST_MODE : "false" } ,
186- } ,
187- ) ;
188-
189- expect ( result . exitCode ) . not . toBe ( 0 ) ;
190- } ,
191- ) ;
192- } ) ;
193-
194- describe ( "Performance and Reliability E2E" , ( ) => {
195- it (
196- "should complete stats retrieval within reasonable time" ,
197- { timeout : 45000 } ,
198- async ( ) => {
199- setupTestFailureHandler (
200- "should complete stats retrieval within reasonable time" ,
201- ) ;
202-
203- const startTime = Date . now ( ) ;
204- const result = await runCommand (
205- [ "connections" , "stats" , "--limit" , "10" ] ,
206- {
207- timeoutMs : 45000 ,
208- env : { ABLY_CLI_TEST_MODE : "false" } ,
209- } ,
210- ) ;
211- const endTime = Date . now ( ) ;
212-
213- expect ( result . exitCode ) . toBe ( 0 ) ;
214- expect ( endTime - startTime ) . toBeLessThan ( 30000 ) ; // Should complete within 30 seconds
215- } ,
216- ) ;
217-
218- it (
219- "should handle multiple consecutive stats requests" ,
220- { timeout : 120000 } ,
221- async ( ) => {
222- setupTestFailureHandler (
223- "should handle multiple consecutive stats requests" ,
224- ) ;
225-
226- // Run multiple stats requests in sequence
227- for ( let i = 0 ; i < 3 ; i ++ ) {
228- const result = await runCommand (
229- [ "connections" , "stats" , "--limit" , "2" ] ,
230- {
231- timeoutMs : 30000 ,
232- env : { ABLY_CLI_TEST_MODE : "false" } ,
233- } ,
234- ) ;
235- expect ( result . exitCode ) . toBe ( 0 ) ;
236- }
237- } ,
238- ) ;
239-
240- it (
241- "should maintain consistent output format across requests" ,
242- { timeout : 90000 } ,
243- async ( ) => {
244- setupTestFailureHandler (
245- "should maintain consistent output format across requests" ,
246- ) ;
247-
248- // Run the same command twice and verify consistent output structure
249- const result1 = await runCommand (
250- [ "connections" , "stats" , "--json" , "--limit" , "2" ] ,
251- {
252- timeoutMs : 45000 ,
253- env : { ABLY_CLI_TEST_MODE : "false" } ,
254- } ,
255- ) ;
256- const result2 = await runCommand (
257- [ "connections" , "stats" , "--json" , "--limit" , "2" ] ,
258- {
259- timeoutMs : 45000 ,
260- env : { ABLY_CLI_TEST_MODE : "false" } ,
261- } ,
262- ) ;
263-
264- expect ( result1 . exitCode ) . toBe ( 0 ) ;
265- expect ( result2 . exitCode ) . toBe ( 0 ) ;
266-
267- // Both should be valid JSON with similar structure
268- let json1 , json2 ;
269- try {
270- json1 = JSON . parse ( result1 . stdout ) ;
271- json2 = JSON . parse ( result2 . stdout ) ;
272- } catch {
273- throw new Error ( "Invalid JSON output in consecutive requests" ) ;
274- }
275-
276- // Both should have the same structure
277- expect ( Object . keys ( json1 ) ) . toEqual ( Object . keys ( json2 ) ) ;
278- } ,
279- ) ;
280153 } ) ;
281154
282155 describe ( "Live Connection Monitoring E2E" , ( ) => {
0 commit comments