| @@ -44,6 +44,7 @@ describe("Open VSX themes", () => { · 43 unmodified lines |
| 44 | extensions: [ | 44 | extensions: [ |
| 45 | { namespace: "demo", name: "theme" }, | 45 | { namespace: "demo", name: "theme" }, |
| 46 | { namespace: "icons", name: "theme" }, | 46 | { namespace: "icons", name: "theme" }, |
| | 47 | { namespace: "oversized", name: "theme" }, |
| 47 | { namespace: "closed", name: "theme" }, | 48 | { namespace: "closed", name: "theme" }, |
| 48 | { namespace: "huge", name: "theme" }, | 49 | { namespace: "huge", name: "theme" }, |
| 49 | ], | 50 | ], |
| @@ -65,6 +66,20 @@ describe("Open VSX themes", () => { · 15 unmodified lines |
| 65 | { status: 200 }, | 66 | { status: 200 }, |
| 66 | ); | 67 | ); |
| 67 | } | 68 | } |
| | 69 | if (url.endsWith("/oversized/theme")) { |
| | 70 | return new Response( |
| | 71 | JSON.stringify( |
| | 72 | extensionDetail({ |
| | 73 | namespace: "oversized", |
| | 74 | files: { |
| | 75 | ...extensionDetail().files, |
| | 76 | download: `${ASSET_ROOT.replace("demo/theme", "oversized/theme")}/oversized.vsix`, |
| | 77 | }, |
| | 78 | }), |
| | 79 | ), |
| | 80 | { status: 200 }, |
| | 81 | ); |
| | 82 | } |
| 68 | if (url.endsWith("/closed/theme")) { | 83 | if (url.endsWith("/closed/theme")) { |
| 69 | return new Response( | 84 | return new Response( |
| 70 | JSON.stringify(extensionDetail({ namespace: "closed", license: "All Rights Reserved" })), | 85 | JSON.stringify(extensionDetail({ namespace: "closed", license: "All Rights Reserved" })), |
| @@ -74,6 +89,15 @@ describe("Open VSX themes", () => { · 3 unmodified lines |
| 74 | if (url.endsWith("/huge/theme")) { | 89 | if (url.endsWith("/huge/theme")) { |
| 75 | return new Response(JSON.stringify({ padding: "x".repeat(256 * 1024) }), { status: 200 }); | 90 | return new Response(JSON.stringify({ padding: "x".repeat(256 * 1024) }), { status: 200 }); |
| 76 | } | 91 | } |
| | 92 | if (url.endsWith("/oversized/theme/1.0.0/file/oversized.vsix")) { |
| | 93 | return new Response(null, { |
| | 94 | headers: { "content-length": String(20 * 1024 * 1024 + 1) }, |
| | 95 | status: 200, |
| | 96 | }); |
| | 97 | } |
| | 98 | if (url.endsWith(".vsix")) { |
| | 99 | return new Response(null, { headers: { "content-length": "1024" }, status: 200 }); |
| | 100 | } |
| 77 | if (url.endsWith("/icons/theme/1.0.0/file/package.json")) { | 101 | if (url.endsWith("/icons/theme/1.0.0/file/package.json")) { |
| 78 | return new Response(JSON.stringify({ contributes: { iconThemes: [{}] } }), { status: 200 }); | 102 | return new Response(JSON.stringify({ contributes: { iconThemes: [{}] } }), { status: 200 }); |
| 79 | } | 103 | } |