Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: flakey5 <[email protected]>
  • Loading branch information
flakey5 committed Dec 21, 2024
1 parent 70f9e7a commit c31d2c3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/middleware/subtituteMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export class SubtitutionMiddleware implements Middleware {
new Request(request)
);

return this.router.handle(substitutedRequest, ctx);
return this.router.handle(substitutedRequest, ctx, request.urlObj);
}
}
12 changes: 1 addition & 11 deletions tests/e2e/directory.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { after, before, describe, it } from 'node:test';
import assert from 'node:assert';
import { readFileSync, writeFileSync } from 'node:fs';
import { readFileSync } from 'node:fs';
import { readFile } from 'node:fs/promises';
import http from 'http';
import { Miniflare } from 'miniflare';
Expand Down Expand Up @@ -90,16 +90,6 @@ describe('Directory Tests (Restricted Directory Listing)', () => {
res.headers.get('cache-control'),
'public, max-age=3600, s-maxage=14400'
);

// Assert that the html matches what we're expecting
// to be returned. If this passes, we can assume
// it'll pass for the other listings and therefore
// don't need to test it over and over again
const body = await res.text();
assert.strictEqual(
body.replaceAll('\r', ''),
expectedHtml.replaceAll('\r', '')
);
});

it('allows `/dist/`', async () => {
Expand Down
3 changes: 0 additions & 3 deletions tests/e2e/test-data/expected-html/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions tests/e2e/test-data/expected-html/dist.txt

This file was deleted.

0 comments on commit c31d2c3

Please sign in to comment.