@quantcdn/edge-conformance 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,361 @@
1
+ {
2
+ "cases": [
3
+ {
4
+ "id": "static-root-serves-index-html",
5
+ "description": "The path / serves index.html.",
6
+ "tags": [
7
+ "static"
8
+ ],
9
+ "op": "serveStatic",
10
+ "input": {
11
+ "files": {
12
+ "index.html": "<h1>Home</h1>",
13
+ "about/index.html": "<h1>About</h1>",
14
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
15
+ "contact.html": "<h1>Contact</h1>",
16
+ "css/site.css": "body { color: #000; }",
17
+ "js/app.js": "console.log(\"app\");",
18
+ "data/items.json": "{\"items\":[]}",
19
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
20
+ "files/digits.txt": "0123456789",
21
+ "_quant404/index.html": "<h1>Not here</h1>"
22
+ },
23
+ "request": {
24
+ "method": "GET",
25
+ "url": "https://www.example.com/"
26
+ }
27
+ },
28
+ "expect": {
29
+ "status": 200,
30
+ "headers": {
31
+ "content-type": {
32
+ "startsWith": "text/html"
33
+ }
34
+ },
35
+ "bodyText": "<h1>Home</h1>"
36
+ }
37
+ },
38
+ {
39
+ "id": "static-index-html-path",
40
+ "description": "A request for /about/index.html serves about/index.html.",
41
+ "tags": [
42
+ "static"
43
+ ],
44
+ "op": "serveStatic",
45
+ "input": {
46
+ "files": {
47
+ "index.html": "<h1>Home</h1>",
48
+ "about/index.html": "<h1>About</h1>",
49
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
50
+ "contact.html": "<h1>Contact</h1>",
51
+ "css/site.css": "body { color: #000; }",
52
+ "js/app.js": "console.log(\"app\");",
53
+ "data/items.json": "{\"items\":[]}",
54
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
55
+ "files/digits.txt": "0123456789",
56
+ "_quant404/index.html": "<h1>Not here</h1>"
57
+ },
58
+ "request": {
59
+ "method": "GET",
60
+ "url": "https://www.example.com/about/index.html"
61
+ }
62
+ },
63
+ "expect": {
64
+ "status": 200,
65
+ "headers": {
66
+ "content-type": {
67
+ "startsWith": "text/html"
68
+ }
69
+ },
70
+ "bodyText": "<h1>About</h1>"
71
+ }
72
+ },
73
+ {
74
+ "id": "static-directory-with-trailing-slash",
75
+ "description": "The path /about/ serves about/index.html.",
76
+ "tags": [
77
+ "static"
78
+ ],
79
+ "op": "serveStatic",
80
+ "input": {
81
+ "files": {
82
+ "index.html": "<h1>Home</h1>",
83
+ "about/index.html": "<h1>About</h1>",
84
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
85
+ "contact.html": "<h1>Contact</h1>",
86
+ "css/site.css": "body { color: #000; }",
87
+ "js/app.js": "console.log(\"app\");",
88
+ "data/items.json": "{\"items\":[]}",
89
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
90
+ "files/digits.txt": "0123456789",
91
+ "_quant404/index.html": "<h1>Not here</h1>"
92
+ },
93
+ "request": {
94
+ "method": "GET",
95
+ "url": "https://www.example.com/about/"
96
+ }
97
+ },
98
+ "expect": {
99
+ "status": 200,
100
+ "headers": {
101
+ "content-type": {
102
+ "startsWith": "text/html"
103
+ }
104
+ },
105
+ "bodyText": "<h1>About</h1>"
106
+ }
107
+ },
108
+ {
109
+ "id": "static-directory-without-trailing-slash",
110
+ "description": "The path /about serves about/index.html.",
111
+ "tags": [
112
+ "static"
113
+ ],
114
+ "op": "serveStatic",
115
+ "input": {
116
+ "files": {
117
+ "index.html": "<h1>Home</h1>",
118
+ "about/index.html": "<h1>About</h1>",
119
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
120
+ "contact.html": "<h1>Contact</h1>",
121
+ "css/site.css": "body { color: #000; }",
122
+ "js/app.js": "console.log(\"app\");",
123
+ "data/items.json": "{\"items\":[]}",
124
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
125
+ "files/digits.txt": "0123456789",
126
+ "_quant404/index.html": "<h1>Not here</h1>"
127
+ },
128
+ "request": {
129
+ "method": "GET",
130
+ "url": "https://www.example.com/about"
131
+ }
132
+ },
133
+ "expect": {
134
+ "status": 200,
135
+ "headers": {
136
+ "content-type": {
137
+ "startsWith": "text/html"
138
+ }
139
+ },
140
+ "bodyText": "<h1>About</h1>"
141
+ }
142
+ },
143
+ {
144
+ "id": "static-nested-directory",
145
+ "description": "A nested directory serves its index.html.",
146
+ "tags": [
147
+ "static"
148
+ ],
149
+ "op": "serveStatic",
150
+ "input": {
151
+ "files": {
152
+ "index.html": "<h1>Home</h1>",
153
+ "about/index.html": "<h1>About</h1>",
154
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
155
+ "contact.html": "<h1>Contact</h1>",
156
+ "css/site.css": "body { color: #000; }",
157
+ "js/app.js": "console.log(\"app\");",
158
+ "data/items.json": "{\"items\":[]}",
159
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
160
+ "files/digits.txt": "0123456789",
161
+ "_quant404/index.html": "<h1>Not here</h1>"
162
+ },
163
+ "request": {
164
+ "method": "GET",
165
+ "url": "https://www.example.com/docs/guide/intro/"
166
+ }
167
+ },
168
+ "expect": {
169
+ "status": 200,
170
+ "headers": {
171
+ "content-type": {
172
+ "startsWith": "text/html"
173
+ }
174
+ },
175
+ "bodyText": "<h1>Intro</h1>"
176
+ }
177
+ },
178
+ {
179
+ "id": "static-html-file",
180
+ "description": "A file that is not index.html is served at its own path.",
181
+ "tags": [
182
+ "static"
183
+ ],
184
+ "op": "serveStatic",
185
+ "input": {
186
+ "files": {
187
+ "index.html": "<h1>Home</h1>",
188
+ "about/index.html": "<h1>About</h1>",
189
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
190
+ "contact.html": "<h1>Contact</h1>",
191
+ "css/site.css": "body { color: #000; }",
192
+ "js/app.js": "console.log(\"app\");",
193
+ "data/items.json": "{\"items\":[]}",
194
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
195
+ "files/digits.txt": "0123456789",
196
+ "_quant404/index.html": "<h1>Not here</h1>"
197
+ },
198
+ "request": {
199
+ "method": "GET",
200
+ "url": "https://www.example.com/contact.html"
201
+ }
202
+ },
203
+ "expect": {
204
+ "status": 200,
205
+ "headers": {
206
+ "content-type": {
207
+ "startsWith": "text/html"
208
+ }
209
+ },
210
+ "bodyText": "<h1>Contact</h1>"
211
+ }
212
+ },
213
+ {
214
+ "id": "static-query-string-is-ignored",
215
+ "description": "A query string does not change which file is served.",
216
+ "tags": [
217
+ "static"
218
+ ],
219
+ "op": "serveStatic",
220
+ "input": {
221
+ "files": {
222
+ "index.html": "<h1>Home</h1>",
223
+ "about/index.html": "<h1>About</h1>",
224
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
225
+ "contact.html": "<h1>Contact</h1>",
226
+ "css/site.css": "body { color: #000; }",
227
+ "js/app.js": "console.log(\"app\");",
228
+ "data/items.json": "{\"items\":[]}",
229
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
230
+ "files/digits.txt": "0123456789",
231
+ "_quant404/index.html": "<h1>Not here</h1>"
232
+ },
233
+ "request": {
234
+ "method": "GET",
235
+ "url": "https://www.example.com/about/?utm_source=mail"
236
+ }
237
+ },
238
+ "expect": {
239
+ "status": 200,
240
+ "bodyText": "<h1>About</h1>"
241
+ }
242
+ },
243
+ {
244
+ "id": "static-uppercase-request-path",
245
+ "description": "A request path with capitals serves the lowercase path.",
246
+ "tags": [
247
+ "static",
248
+ "unverified"
249
+ ],
250
+ "op": "serveStatic",
251
+ "input": {
252
+ "files": {
253
+ "index.html": "<h1>Home</h1>",
254
+ "about/index.html": "<h1>About</h1>",
255
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
256
+ "contact.html": "<h1>Contact</h1>",
257
+ "css/site.css": "body { color: #000; }",
258
+ "js/app.js": "console.log(\"app\");",
259
+ "data/items.json": "{\"items\":[]}",
260
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
261
+ "files/digits.txt": "0123456789",
262
+ "_quant404/index.html": "<h1>Not here</h1>"
263
+ },
264
+ "request": {
265
+ "method": "GET",
266
+ "url": "https://www.example.com/ABOUT/"
267
+ }
268
+ },
269
+ "expect": {
270
+ "status": 200,
271
+ "bodyText": "<h1>About</h1>"
272
+ }
273
+ },
274
+ {
275
+ "id": "static-custom-404",
276
+ "description": "A path with no file serves /_quant404 with status 404.",
277
+ "tags": [
278
+ "static"
279
+ ],
280
+ "op": "serveStatic",
281
+ "input": {
282
+ "files": {
283
+ "index.html": "<h1>Home</h1>",
284
+ "about/index.html": "<h1>About</h1>",
285
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
286
+ "contact.html": "<h1>Contact</h1>",
287
+ "css/site.css": "body { color: #000; }",
288
+ "js/app.js": "console.log(\"app\");",
289
+ "data/items.json": "{\"items\":[]}",
290
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
291
+ "files/digits.txt": "0123456789",
292
+ "_quant404/index.html": "<h1>Not here</h1>"
293
+ },
294
+ "request": {
295
+ "method": "GET",
296
+ "url": "https://www.example.com/missing/"
297
+ }
298
+ },
299
+ "expect": {
300
+ "status": 404,
301
+ "headers": {
302
+ "content-type": {
303
+ "startsWith": "text/html"
304
+ }
305
+ },
306
+ "bodyText": "<h1>Not here</h1>"
307
+ }
308
+ },
309
+ {
310
+ "id": "static-custom-404-for-a-missing-asset",
311
+ "description": "A missing asset also gets the /_quant404 page.",
312
+ "tags": [
313
+ "static"
314
+ ],
315
+ "op": "serveStatic",
316
+ "input": {
317
+ "files": {
318
+ "index.html": "<h1>Home</h1>",
319
+ "about/index.html": "<h1>About</h1>",
320
+ "docs/guide/intro/index.html": "<h1>Intro</h1>",
321
+ "contact.html": "<h1>Contact</h1>",
322
+ "css/site.css": "body { color: #000; }",
323
+ "js/app.js": "console.log(\"app\");",
324
+ "data/items.json": "{\"items\":[]}",
325
+ "img/logo.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>",
326
+ "files/digits.txt": "0123456789",
327
+ "_quant404/index.html": "<h1>Not here</h1>"
328
+ },
329
+ "request": {
330
+ "method": "GET",
331
+ "url": "https://www.example.com/css/missing.css"
332
+ }
333
+ },
334
+ "expect": {
335
+ "status": 404,
336
+ "bodyText": "<h1>Not here</h1>"
337
+ }
338
+ },
339
+ {
340
+ "id": "static-404-without-a-custom-page",
341
+ "description": "Without /_quant404, a path with no file answers 404.",
342
+ "tags": [
343
+ "static"
344
+ ],
345
+ "op": "serveStatic",
346
+ "input": {
347
+ "files": {
348
+ "index.html": "<h1>Home</h1>",
349
+ "404.html": "<h1>Old style</h1>"
350
+ },
351
+ "request": {
352
+ "method": "GET",
353
+ "url": "https://www.example.com/missing/"
354
+ }
355
+ },
356
+ "expect": {
357
+ "status": 404
358
+ }
359
+ }
360
+ ]
361
+ }