Skip to content

Commit

Permalink
test: use Astro v5 and update cloudflare assertions (#460)
Browse files Browse the repository at this point in the history
* test: use Astro v5 and update cloudflare assertions

* disable check origin

* disable check origin

* update test

* fix another test

* remove logging

* format
  • Loading branch information
ematipico authored Dec 3, 2024
1 parent 7057f09 commit 3d94421
Show file tree
Hide file tree
Showing 56 changed files with 200 additions and 178 deletions.
2 changes: 1 addition & 1 deletion packages/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"devDependencies": {
"@astrojs/test-utils": "workspace:*",
"astro": "^5.0.0-alpha.15",
"astro": "^5.0.0",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0",
"execa": "^8.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@astrojs/cloudflare": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
},
"devDependencies": {
"wrangler": "^3.84.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/test/fixtures/astro-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@astrojs/cloudflare": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
},
"devDependencies": {
"wrangler": "^3.84.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/cloudflare": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/cloudflare": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/cloudflare": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/cloudflare/test/fixtures/no-output/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/cloudflare": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/cloudflare/test/fixtures/routes-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/cloudflare": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@astrojs/cloudflare": "workspace:*",
"@astrojs/solid-js": "^4.4.2",
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"solid-js": "^1.9.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/cloudflare": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
10 changes: 5 additions & 5 deletions packages/cloudflare/test/routes-json.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('_routes.json generation', () => {

assert.deepEqual(routes, {
version: 1,
include: ['/a/*', '/_image'],
include: ['/_image', '/a/*'],
exclude: ['/_astro/*', '/redirectme', '/public.txt', '/a', '/a/redirect', '/404', '/b'],
});
});
Expand Down Expand Up @@ -101,7 +101,7 @@ describe('_routes.json generation', () => {

assert.deepEqual(routes, {
version: 1,
include: ['/a/*', '/_image', '/another'],
include: ['/_image', '/a/*', '/another'],
exclude: ['/_astro/*', '/redirectme', '/public.txt', '/a', '/a/redirect', '/404', '/b'],
});
});
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('_routes.json generation', () => {

assert.deepEqual(routes, {
version: 1,
include: ['/a/*', '/_image'],
include: ['/_image', '/a/*'],
exclude: [
'/_astro/*',
'/redirectme',
Expand Down Expand Up @@ -167,10 +167,10 @@ describe('_routes.json generation', () => {
version: 1,
include: [
'/',
'/_image',
'/dynamicPages/*',
'/mixedPages/dynamic',
'/mixedPages/subfolder/dynamic',
'/_image',
],
exclude: [
'/_astro/*',
Expand Down Expand Up @@ -234,7 +234,7 @@ describe('_routes.json generation', () => {

assert.deepEqual(routes, {
version: 1,
include: ['/dynamic', '/_image'],
include: ['/_image', '/dynamic'],
exclude: [],
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/netlify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@netlify/edge-functions": "^2.11.1",
"@netlify/edge-handler-types": "^0.34.1",
"@types/node": "^22.10.0",
"astro": "^5.0.0-alpha.15",
"astro": "^5.0.0",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0",
"execa": "^8.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ export default defineConfig({
output: 'server',
adapter: netlify(),
site: `http://example.com`,
security: {
checkOrigin: false
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"dependencies": {
"@astrojs/netlify": "workspace:*",
"astro": "^5.0.0-alpha.15"
"astro": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/node": "^22.10.0",
"@types/send": "^0.17.4",
"@types/server-destroy": "^1.0.4",
"astro": "^5.0.0-alpha.15",
"astro": "^5.0.0",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0",
"express": "^4.21.1",
Expand Down
7 changes: 7 additions & 0 deletions packages/node/test/fixtures/api-route/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig} from "astro/config";

export default defineConfig({
security: {
checkOrigin: false
}
})
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/api-route/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APIContext } from 'astro';
import type { APIContext } from 'astro';

export async function GET({ redirect }: APIContext) {
return redirect('/destination');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APIContext } from 'astro';
import type { APIContext } from 'astro';

export async function GET({ url: requestUrl }: APIContext) {
return Response.redirect(new URL('/destination', requestUrl), 307);
Expand Down
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/bad-urls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/encoded/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/headers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
},
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/node/test/fixtures/locals/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {defineConfig} from "astro/config";

export default defineConfig({
security: {
checkOrigin:false
}
})
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/locals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/node-middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/prerender-404-500/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/prerender/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/preview-headers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/trailing-slash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/node/test/fixtures/url/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0",
"@astrojs/node": "workspace:*"
}
}
8 changes: 4 additions & 4 deletions packages/node/test/node-middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('behavior from middleware, middleware', () => {
const { handler } = await fixture.loadAdapterEntryModule();
const app = express();
app.use(handler);
server = app.listen(8888);
server = app.listen(8889);
});

after(async () => {
Expand All @@ -76,10 +76,10 @@ describe('behavior from middleware, middleware', () => {
delete process.env.PRERENDER;
});

it('when mode is standalone', async () => {
// biome-ignore lint/style/noUnusedTemplateLiteral: <explanation>
const res = await fetch(`http://localhost:8888/ssr`);
it('when mode is middleware', async () => {
const res = await fetch('http://localhost:8889/ssr');

console.log(res);
assert.equal(res.status, 200);

const html = await res.text();
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"keywords": [],
"dependencies": {
"astro": "^5.0.0-alpha.15",
"astro": "^5.0.0",
"execa": "^8.0.1",
"fast-glob": "^3.3.2",
"strip-ansi": "^7.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"devDependencies": {
"@astrojs/test-utils": "workspace:*",
"astro": "^5.0.0-alpha.15",
"astro": "^5.0.0",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vercel/test/fixtures/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/vercel": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/vercel/test/fixtures/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"dependencies": {
"@astrojs/vercel": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/vercel/test/fixtures/isr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/vercel": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/vercel/test/fixtures/max-duration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/vercel": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0"
}
}
Loading

0 comments on commit 3d94421

Please sign in to comment.