mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
test(cctv): make the oversized Houston catalog fixture valid JSON
The streamed oversized body was invalid JSON, so the loader returned nothing whether or not the byte cap applied. Pad a valid catalog with a usable camera instead, so only the cap can refuse it.
This commit is contained in:
1 parent
f120989a2b
commit
c66f8f039b
1 file changed
+5
-1
@@ -236,7 +236,11 @@ test('the catalog fetch refuses redirects and oversized bodies', async (t) => {
|
||||
t.mock.restoreAll();
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
t.mock.method(globalThis, 'fetch', async () => {
|
||||
const oversized = 'x'.repeat(HOUSTON_MAX_CATALOG_BYTES + 1024);
|
||||
// Valid JSON with a usable camera, so only the byte cap can refuse it.
|
||||
const oversized = JSON.stringify({
|
||||
cameras: [row()],
|
||||
padding: 'x'.repeat(HOUSTON_MAX_CATALOG_BYTES + 1024),
|
||||
});
|
||||
return new Response(
|
||||
new ReadableStream({
|
||||
start(controller) {
|
||||
|
||||
Reference in new issue
Block a user