diff options
author | 2025-06-05 14:25:23 +0000 | |
---|---|---|
committer | 2025-06-05 14:25:23 +0000 | |
commit | e586d7d704d475afe3373a1de6ae20d504f79d6d (patch) | |
tree | 7e3fa24807cebd48a86bd40f866d792181191ee9 /packages/integrations/vercel/test/hosted | |
download | astro-latest.tar.gz astro-latest.tar.zst astro-latest.zip |
Sync from a8e1c0a7402940e0fc5beef669522b315052df1blatest
Diffstat (limited to 'packages/integrations/vercel/test/hosted')
6 files changed, 43 insertions, 0 deletions
diff --git a/packages/integrations/vercel/test/hosted/README.md b/packages/integrations/vercel/test/hosted/README.md new file mode 100644 index 000000000..9dbb9bbc0 --- /dev/null +++ b/packages/integrations/vercel/test/hosted/README.md @@ -0,0 +1,3 @@ +The tests in this folder are done directly on a deployed Vercel website (hosted at https://astro-vercel-image-test.vercel.app) and are not run by the test suite. They instead run every week through a GitHub action. + +The purpose of those tests is to make sure that everything works as expected while deployed. In a way, they're as E2E as it gets. diff --git a/packages/integrations/vercel/test/hosted/hosted-astro-project/astro.config.mjs b/packages/integrations/vercel/test/hosted/hosted-astro-project/astro.config.mjs new file mode 100644 index 000000000..28544e7e9 --- /dev/null +++ b/packages/integrations/vercel/test/hosted/hosted-astro-project/astro.config.mjs @@ -0,0 +1,8 @@ +import vercel from '@astrojs/vercel'; +import { defineConfig } from 'astro/config'; + +// https://astro.build/config +export default defineConfig({ + output: 'server', + adapter: vercel(), +}); diff --git a/packages/integrations/vercel/test/hosted/hosted-astro-project/package.json b/packages/integrations/vercel/test/hosted/hosted-astro-project/package.json new file mode 100644 index 000000000..b20c4385b --- /dev/null +++ b/packages/integrations/vercel/test/hosted/hosted-astro-project/package.json @@ -0,0 +1,12 @@ +{ + "name": "vercel-hosted-astro-project", + "version": "0.0.0", + "private": true, + "scripts": { + "build": "astro build" + }, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "workspace:*" + } +} diff --git a/packages/integrations/vercel/test/hosted/hosted-astro-project/src/assets/penguin.png b/packages/integrations/vercel/test/hosted/hosted-astro-project/src/assets/penguin.png Binary files differnew file mode 100644 index 000000000..218acde5b --- /dev/null +++ b/packages/integrations/vercel/test/hosted/hosted-astro-project/src/assets/penguin.png diff --git a/packages/integrations/vercel/test/hosted/hosted-astro-project/src/pages/index.astro b/packages/integrations/vercel/test/hosted/hosted-astro-project/src/pages/index.astro new file mode 100644 index 000000000..256bfb407 --- /dev/null +++ b/packages/integrations/vercel/test/hosted/hosted-astro-project/src/pages/index.astro @@ -0,0 +1,6 @@ +--- +import { Image } from 'astro:assets'; +import penguin from '../assets/penguin.png'; +--- + +<Image src={penguin} width={300} alt="" /> diff --git a/packages/integrations/vercel/test/hosted/hosted.test.js b/packages/integrations/vercel/test/hosted/hosted.test.js new file mode 100644 index 000000000..e090188a7 --- /dev/null +++ b/packages/integrations/vercel/test/hosted/hosted.test.js @@ -0,0 +1,14 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; + +const VERCEL_TEST_URL = 'https://astro-vercel-image-test.vercel.app'; + +describe('Hosted Vercel Tests', () => { + it('Image endpoint works', async () => { + const image = await fetch( + VERCEL_TEST_URL + '/_image?href=%2F_astro%2Fpenguin.e9c64733.png&w=300&f=webp', + ); + + assert.equal(image.status, 200); + }); +}); |