@@ -36,11 +36,9 @@ test('post abort signal', async (t) => {
36
36
37
37
server . listen ( 0 , async ( ) => {
38
38
const ac = new AbortController ( )
39
- const uresPromise = request ( `http://0.0.0.0:${ server . address ( ) . port } ` , { signal : ac . signal } )
39
+ const ures = await request ( `http://0.0.0.0:${ server . address ( ) . port } ` , { signal : ac . signal } )
40
40
ac . abort ( )
41
-
42
41
try {
43
- const ures = await uresPromise
44
42
/* eslint-disable-next-line no-unused-vars */
45
43
for await ( const chunk of ures . body ) {
46
44
// Do nothing...
@@ -63,11 +61,9 @@ test('post abort signal w/ reason', async (t) => {
63
61
server . listen ( 0 , async ( ) => {
64
62
const ac = new AbortController ( )
65
63
const _err = new Error ( )
66
- const uresPromise = request ( `http://0.0.0.0:${ server . address ( ) . port } ` , { signal : ac . signal } )
64
+ const ures = await request ( `http://0.0.0.0:${ server . address ( ) . port } ` , { signal : ac . signal } )
67
65
ac . abort ( _err )
68
-
69
66
try {
70
- const ures = await uresPromise
71
67
/* eslint-disable-next-line no-unused-vars */
72
68
for await ( const chunk of ures . body ) {
73
69
// Do nothing...
@@ -78,20 +74,3 @@ test('post abort signal w/ reason', async (t) => {
78
74
} )
79
75
await t . completed
80
76
} )
81
-
82
- test ( 'post abort signal after request completed' , async ( t ) => {
83
- t = tspl ( t , { plan : 1 } )
84
-
85
- const server = createServer ( ( req , res ) => {
86
- res . end ( 'asd' )
87
- } )
88
- after ( ( ) => server . close ( ) )
89
-
90
- server . listen ( 0 , async ( ) => {
91
- const ac = new AbortController ( )
92
- const ures = await request ( `http://0.0.0.0:${ server . address ( ) . port } ` , { signal : ac . signal } )
93
- ac . abort ( )
94
- t . equal ( await ures . body . text ( ) , 'asd' )
95
- } )
96
- await t . completed
97
- } )
0 commit comments