Skip to content

Commit 01afee2

Browse files
committed
Fix tests
1 parent e46d10c commit 01afee2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

test/fixResponseHeaders.test.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ describe('fixResponseHeaders - multi', () => {
55
it('is removed when the value is "chunked"', () => {
66
const fixed = fixResponseHeaders({
77
"transfer-encoding": "chunked",
8-
}, true)
8+
}, true, false)
99
expect(fixed.multiValueHeaders!['transfer-encoding']).toBeUndefined();
1010
})
1111
it('is not removed when the value is not "chunked"', () => {
1212
const fixed = fixResponseHeaders({
1313
"transfer-encoding": ["not-chunked", "chunked"]
14-
}, true)
14+
}, true, false)
1515
expect(fixed.multiValueHeaders!['transfer-encoding']).toEqual(['not-chunked']);
1616
})
1717
});
@@ -20,7 +20,7 @@ describe('fixResponseHeaders - multi', () => {
2020
it('returns multiple headers with different case', () => {
2121
const fixed = fixResponseHeaders({
2222
"set-cookie": ["a", "b", "c"],
23-
}, true)
23+
}, true, false)
2424
expect(fixed.multiValueHeaders!).toEqual({
2525
"set-cookie": ["a", "b", "c"],
2626
});
@@ -30,7 +30,7 @@ describe('fixResponseHeaders - multi', () => {
3030
it('by default it copies the value', () => {
3131
const fixed = fixResponseHeaders({
3232
"content-length": "100",
33-
}, true)
33+
}, true, false)
3434
expect(fixed.multiValueHeaders!['content-length']).toEqual(['100']);
3535
})
3636
})
@@ -40,13 +40,13 @@ describe('fixResponseHeaders - single', () => {
4040
it('is removed when the value is "chunked"', () => {
4141
const fixed = fixResponseHeaders({
4242
"transfer-encoding": "chunked",
43-
}, false)
43+
}, false, false)
4444
expect(fixed.headers!['transfer-encoding']).toBeUndefined();
4545
})
4646
it('is not removed when the value is not "chunked"', () => {
4747
const fixed = fixResponseHeaders({
4848
"transfer-encoding": "not-chunked"
49-
}, false)
49+
}, false, false)
5050
expect(fixed.headers!['transfer-encoding']).toEqual('not-chunked');
5151
})
5252
});
@@ -55,17 +55,18 @@ describe('fixResponseHeaders - single', () => {
5555
it('sets set-cookie header using different character case', () => {
5656
const fixed = fixResponseHeaders({
5757
"set-cookie": ["a", "b", "c"],
58-
}, false)
58+
}, false, false)
5959
expect(fixed.headers).toEqual({
6060
"set-cookie": "a",
6161
"Set-cookie": "b",
6262
"sEt-cookie": "c",
6363
});
6464
})
65+
6566
it('joins the values with commas for not set-cookie headers', () => {
6667
const fixed = fixResponseHeaders({
6768
"x-header": ["a", "b", "c"],
68-
}, false)
69+
}, false, false)
6970
expect(fixed.headers).toEqual({
7071
"x-header": "a,b,c",
7172
});
@@ -75,7 +76,7 @@ describe('fixResponseHeaders - single', () => {
7576
it('by default it copies the value', () => {
7677
const fixed = fixResponseHeaders({
7778
"content-length": "100",
78-
}, false)
79+
}, false, false)
7980
expect(fixed.headers!['content-length']).toEqual('100');
8081
})
8182

0 commit comments

Comments
 (0)