@@ -51,28 +51,43 @@ describe('send(body)', () => {
51
51
// @ts -ignore
52
52
await fetch . get ( '/' ) . expect ( null )
53
53
} )
54
- /* it('should remove some headers for 204 status', async () => {
54
+ /* it('should remove some headers for 204 status', async () => {
55
55
const { fetch } = InitAppAndTest((req, res) => {
56
56
res.status = 204
57
57
58
58
send(req, res)('Hello World')
59
59
})
60
60
61
- await fetch.get('/').expect('Content-Length', '').expect('Content-Type', '').expect('Transfer-Encoding', '')
61
+ await fetch
62
+ .get('/')
63
+ .expect('Content-Length', '')
64
+ .expect('Content-Type', '')
65
+ .expect('Transfer-Encoding', '')
66
+ .expect('')
62
67
})
63
68
it('should remove some headers for 304 status', async () => {
64
- const { fetch } = InitAppAndTest((req, res) => {
65
- res.status = 304
66
-
67
- send(req, res)('Hello World')
68
- })
69
+ const { fetch } = InitAppAndTest(
70
+ (req, res) => {
71
+ res.status = 304
72
+ res.headers?.delete('Content-Type')
73
+ send(req, res)('Hello World')
74
+ },
75
+ '/',
76
+ {},
77
+ 'get'
78
+ )
69
79
70
- await fetch.get('/').expect('Content-Length', '').expect('Content-Type', '').expect('Transfer-Encoding', '')
71
- })
72
- it("should set Content-Type to application/octet-stream for buffers if the header hasn't been set before", async () => {
80
+ await fetch
81
+ .get('/')
82
+ .expect('Content-Length', '')
83
+ .expect('Content-Type', '')
84
+ .expect('Transfer-Encoding', '')
85
+ .expect('')
86
+ }) */
87
+ /* it("should set Content-Type to application/octet-stream for buffers if the header hasn't been set before", async () => {
73
88
const { fetch } = InitAppAndTest((req, res) => send(req, res)(new TextEncoder().encode('Hello World')).end())
74
89
75
- await fetch.get('/').set('Content-Type', ''). expect('Content-Type', 'application/octet-stream')
90
+ await fetch.get('/').expect('Content-Type', 'application/octet-stream')
76
91
}) */
77
92
} )
78
93
0 commit comments