File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed
test_cases/supabase-issue-29583 Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ // https://github.com/seanmonstar/deno/blob/main/tests/unit_node/http2_test.ts#L115
2
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
+
4
+ import * as http2 from "node:http2" ;
5
+ import { assert , assertEquals } from "jsr:@std/assert" ;
6
+
7
+ const clientSession = http2 . connect ( "https://www.example.com" ) ;
8
+ const req = clientSession . request ( {
9
+ ":method" : "GET" ,
10
+ ":path" : "/" ,
11
+ } ) ;
12
+ let headers = { } ;
13
+ let status : number | undefined = 0 ;
14
+ let chunk = new Uint8Array ( ) ;
15
+ const endPromise = Promise . withResolvers < void > ( ) ;
16
+ req . on ( "response" , ( h ) => {
17
+ status = h [ ":status" ] ;
18
+ headers = h ;
19
+ } ) ;
20
+ req . on ( "data" , ( c ) => {
21
+ chunk = c ;
22
+ } ) ;
23
+ req . on ( "end" , ( ) => {
24
+ clientSession . close ( ) ;
25
+ req . close ( ) ;
26
+ endPromise . resolve ( ) ;
27
+ } ) ;
28
+ req . end ( ) ;
29
+ await endPromise . promise ;
30
+ assert ( Object . keys ( headers ) . length > 0 ) ;
31
+ assertEquals ( status , 200 ) ;
32
+ assert ( chunk . length > 0 ) ;
33
+ assert ( clientSession . socket ) ;
34
+
35
+ export default {
36
+ fetch ( ) {
37
+ return new Response ( null ) ;
38
+ } ,
39
+ } ;
Original file line number Diff line number Diff line change @@ -2349,6 +2349,24 @@ async fn test_issue_456() {
2349
2349
tb. exit ( Duration :: from_secs ( TESTBED_DEADLINE_SEC ) ) . await ;
2350
2350
}
2351
2351
2352
+ #[ tokio:: test]
2353
+ #[ serial]
2354
+ async fn test_supabase_issue_29583 ( ) {
2355
+ integration_test ! (
2356
+ "./test_cases/main" ,
2357
+ NON_SECURE_PORT ,
2358
+ "supabase-issue-29583" ,
2359
+ None ,
2360
+ None ,
2361
+ None ,
2362
+ ( |resp| async {
2363
+ let resp = resp. unwrap( ) ;
2364
+ assert_eq!( resp. status( ) . as_u16( ) , StatusCode :: OK ) ;
2365
+ } ) ,
2366
+ TerminationToken :: new( )
2367
+ ) ;
2368
+ }
2369
+
2352
2370
#[ tokio:: test]
2353
2371
#[ serial]
2354
2372
async fn test_should_render_detailed_failed_to_create_graph_error ( ) {
You can’t perform that action at this time.
0 commit comments