Skip to content

Commit

Permalink
fix: remove fixture with spaced name
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Jan 11, 2024
1 parent 58a23a1 commit ff040fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
3 changes: 0 additions & 3 deletions fixtures/test file.json

This file was deleted.

34 changes: 18 additions & 16 deletions send_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,24 @@ test({
},
});

test({
name: "send file with spaces",
async fn() {
const { context } = setup("/test%20file.json");
const fixture = await Deno.readFile("./fixtures/test file.json");
await send(context, context.request.url.pathname, {
root: "./fixtures",
maxbuffer: 0,
});
const nativeResponse = await context.response.toDomResponse();
assertEquals(new Uint8Array(await nativeResponse.arrayBuffer()), fixture);
assertEquals(context.response.type, ".json");
assertStrictEquals(context.response.headers.get("content-encoding"), null);
context.response.destroy();
},
});
// JSR does not support uploading files with spaces in their filename and
// currently doesn't support excluding certain files.
// test({
// name: "send file with spaces",
// async fn() {
// const { context } = setup("/test%20file.json");
// const fixture = await Deno.readFile("./fixtures/test file.json");
// await send(context, context.request.url.pathname, {
// root: "./fixtures",
// maxbuffer: 0,
// });
// const nativeResponse = await context.response.toDomResponse();
// assertEquals(new Uint8Array(await nativeResponse.arrayBuffer()), fixture);
// assertEquals(context.response.type, ".json");
// assertStrictEquals(context.response.headers.get("content-encoding"), null);
// context.response.destroy();
// },
// });

test({
name: "send hidden file throws 403",
Expand Down

0 comments on commit ff040fc

Please sign in to comment.