Skip to content

Commit

Permalink
chore: remove failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Jun 23, 2023
1 parent 3dd7012 commit c62ecfa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
2 changes: 2 additions & 0 deletions packages/astro/src/core/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ class AstroBuilder {
debug('build', timerMessage('Additional assets copied', this.timer.assetsStart));

let newMiddlewareEntryPoint = undefined;
// during the last phase of the build, the emitted code gets copied inside
// `dist/server/` folder, so we need to shred the old URL and make a new one again
if (internals.middlewareEntryPoint && isServerLikeOutput(this.settings.config)) {
const outDir = fileURLToPath(this.settings.config.outDir);
const middlewareRelativePath = fileURLToPath(internals.middlewareEntryPoint).slice(
Expand Down
12 changes: 0 additions & 12 deletions packages/integrations/vercel/src/serverless/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ export default function vercelServerless({
// Remove temporary folder
await removeDir(buildTempFolder);

// Write middleware
await writeFile(new URL('./middleware.js', functionFolder), generateMiddlewareCode());

// Enable ESM
// https://aws.amazon.com/blogs/compute/using-node-js-es-modules-and-top-level-await-in-aws-lambda/
await writeJson(new URL(`./package.json`, functionFolder), {
Expand Down Expand Up @@ -149,12 +146,3 @@ function getRuntime() {
const major = version.split('.')[0]; // '16.5.0' --> '16'
return `nodejs${major}.x`;
}

function generateMiddlewareCode() {
return `
import {onRequest} from "somethere";
export default function middleware(request, context) {
return onRequest(request)
}
`;
}
5 changes: 0 additions & 5 deletions packages/integrations/vercel/test/edge-middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@ describe('Serverless prerender', () => {
root: './fixtures/middleware/',
});
});

it('build successful', async () => {
await fixture.build();
expect(await fixture.readFile('../.vercel/output/static/index.html')).to.be.ok;
});
});

0 comments on commit c62ecfa

Please sign in to comment.