Skip to content

Commit

Permalink
chore: remove unwanted test
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Apr 22, 2024
1 parent c3ae632 commit 7ab1341
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
2 changes: 0 additions & 2 deletions packages/astro/src/core/render-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import { callMiddleware } from './middleware/callMiddleware.js';
import { sequence } from './middleware/index.js';
import { renderRedirect } from './redirects/render.js';
import { type Pipeline, Slots, getParams, getProps } from './render/index.js';
import { fileURLToPath } from 'node:url';
import { joinPaths } from '@astrojs/internal-helpers/path';

/**
* Each request is rendered using a `RenderContext`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { defineMiddleware } from 'astro:middleware';

export const onRequest = defineMiddleware(async (context, next) => {
console.log('[MIDDLEWARE] in ' + context.url.toString());
return next();
Expand Down
23 changes: 0 additions & 23 deletions packages/astro/test/middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,26 +377,3 @@ describe(
});
}
);

describe('middleware with virtual routes', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
let devServer;

before(async () => {
fixture = await loadFixture({
root: './fixtures/middleware-virtual/',
});
devServer = await fixture.startDevServer();
});

after(async () => {
await devServer.stop();
});

it("should touch the middleware when a route doesn't exist", async () => {
const html = await fixture.fetch('/ahahah').then((res) => res.text());
const $ = cheerio.load(html);
assert.equal($('p').html(), 'bar');
});
});

0 comments on commit 7ab1341

Please sign in to comment.