Skip to content

Commit 6a95ba9

Browse files
committed
Add tests for http-tests#78
1 parent b0eeee9 commit 6a95ba9

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

tests/interim.mjs

+65
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,71 @@ export default
5454
expected_type: 'cached'
5555
}
5656
]
57+
},
58+
{
59+
name: 'An HTTP cache should not cache non-final responses',
60+
id: 'interim-not-cached',
61+
browser_skip: true,
62+
kind: 'required',
63+
requests: [
64+
{
65+
interim_responses: [
66+
[103, [
67+
['link', '</styles.css>; rel=preload; as=style']
68+
]]
69+
],
70+
expected_interim_responses: [
71+
[103, [
72+
['link', '</styles.css>; rel=preload; as=style']
73+
]]
74+
],
75+
response_headers: [
76+
['Cache-Control', 'max-age=100000'],
77+
['Date', 0]
78+
],
79+
pause_after: true
80+
},
81+
{
82+
expected_type: 'cached',
83+
expected_interim_responses: []
84+
}
85+
]
86+
},
87+
{
88+
name: 'An optimal HTTP cache should not store headers from non-final responses',
89+
id: 'interim-no-header-reuse',
90+
browser_skip: true,
91+
kind: 'optimal',
92+
requests: [
93+
{
94+
interim_responses: [
95+
[103, [
96+
['link', '</styles.css>; rel=preload; as=style'],
97+
['x-my-header', 'test']
98+
]]
99+
],
100+
expected_interim_responses: [
101+
[103, [
102+
['link', '</styles.css>; rel=preload; as=style'],
103+
['x-my-header', 'test']
104+
]]
105+
],
106+
response_headers: [
107+
['Cache-Control', 'max-age=100000'],
108+
['Date', 0]
109+
],
110+
expected_response_headers_missing: [
111+
'x-my-header'
112+
],
113+
pause_after: true
114+
},
115+
{
116+
expected_type: 'cached',
117+
expected_response_headers_missing: [
118+
'x-my-header'
119+
]
120+
}
121+
]
57122
}
58123
]
59124
}

0 commit comments

Comments
 (0)