diff options
Diffstat (limited to 'packages/integrations/node/test')
21 files changed, 33 insertions, 107 deletions
diff --git a/packages/integrations/node/test/api-route.test.js b/packages/integrations/node/test/api-route.test.js index 5eca5c530..05cdcd637 100644 --- a/packages/integrations/node/test/api-route.test.js +++ b/packages/integrations/node/test/api-route.test.js @@ -7,7 +7,7 @@ import { createRequestAndResponse, loadFixture } from './test-utils.js'; describe('API routes', () => { /** @type {import('./test-utils').Fixture} */ let fixture; - /** @type {import('astro/src/@types/astro.js').PreviewServer} */ + /** @type {import('../../../astro/src/types/public/preview.js').PreviewServer} */ let previewServer; /** @type {URL} */ let baseUri; diff --git a/packages/integrations/node/test/fixtures/api-route/package.json b/packages/integrations/node/test/fixtures/api-route/package.json index 1bb47f080..637f39faa 100644 --- a/packages/integrations/node/test/fixtures/api-route/package.json +++ b/packages/integrations/node/test/fixtures/api-route/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/bad-urls/package.json b/packages/integrations/node/test/fixtures/bad-urls/package.json index 007734a39..5e3b876f7 100644 --- a/packages/integrations/node/test/fixtures/bad-urls/package.json +++ b/packages/integrations/node/test/fixtures/bad-urls/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/encoded/package.json b/packages/integrations/node/test/fixtures/encoded/package.json index 0b8b58a1e..d7f7b5d46 100644 --- a/packages/integrations/node/test/fixtures/encoded/package.json +++ b/packages/integrations/node/test/fixtures/encoded/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/errors/package.json b/packages/integrations/node/test/fixtures/errors/package.json index 3bf69aa0c..4d3bc7e6d 100644 --- a/packages/integrations/node/test/fixtures/errors/package.json +++ b/packages/integrations/node/test/fixtures/errors/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/headers/package.json b/packages/integrations/node/test/fixtures/headers/package.json index 1b7918c3b..15c27a535 100644 --- a/packages/integrations/node/test/fixtures/headers/package.json +++ b/packages/integrations/node/test/fixtures/headers/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/image/package.json b/packages/integrations/node/test/fixtures/image/package.json index 389fb1539..3ec204280 100644 --- a/packages/integrations/node/test/fixtures/image/package.json +++ b/packages/integrations/node/test/fixtures/image/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" }, "scripts": { diff --git a/packages/integrations/node/test/fixtures/locals/package.json b/packages/integrations/node/test/fixtures/locals/package.json index 893e5a246..6d98bd314 100644 --- a/packages/integrations/node/test/fixtures/locals/package.json +++ b/packages/integrations/node/test/fixtures/locals/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/node-middleware/package.json b/packages/integrations/node/test/fixtures/node-middleware/package.json index d07d78227..d2b924c80 100644 --- a/packages/integrations/node/test/fixtures/node-middleware/package.json +++ b/packages/integrations/node/test/fixtures/node-middleware/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/prerender-404-500/package.json b/packages/integrations/node/test/fixtures/prerender-404-500/package.json index 87961fb4f..c1dc8b45d 100644 --- a/packages/integrations/node/test/fixtures/prerender-404-500/package.json +++ b/packages/integrations/node/test/fixtures/prerender-404-500/package.json @@ -4,7 +4,7 @@ "private": true, "type": "module", "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/prerender/package.json b/packages/integrations/node/test/fixtures/prerender/package.json index 746d9a029..e6eb79d06 100644 --- a/packages/integrations/node/test/fixtures/prerender/package.json +++ b/packages/integrations/node/test/fixtures/prerender/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/prerender/src/middleware.ts b/packages/integrations/node/test/fixtures/prerender/src/middleware.ts index 13d619d78..3083acd24 100644 --- a/packages/integrations/node/test/fixtures/prerender/src/middleware.ts +++ b/packages/integrations/node/test/fixtures/prerender/src/middleware.ts @@ -1,7 +1,5 @@ import { shared } from './shared'; export const onRequest = (ctx, next) => { - ctx.locals = { - name: shared, - }; + ctx.locals.name = shared; return next(); }; diff --git a/packages/integrations/node/test/fixtures/prerender/src/pages/two.astro b/packages/integrations/node/test/fixtures/prerender/src/pages/two.astro index c0e5d07aa..beb6e8d78 100644 --- a/packages/integrations/node/test/fixtures/prerender/src/pages/two.astro +++ b/packages/integrations/node/test/fixtures/prerender/src/pages/two.astro @@ -1,5 +1,5 @@ --- -export const prerender = import.meta.env.PRERENDER; +export const prerender = true; --- <html> <head> diff --git a/packages/integrations/node/test/fixtures/preview-headers/package.json b/packages/integrations/node/test/fixtures/preview-headers/package.json index 491bfc15f..a7e64b2c6 100644 --- a/packages/integrations/node/test/fixtures/preview-headers/package.json +++ b/packages/integrations/node/test/fixtures/preview-headers/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/trailing-slash/astro.config.mjs b/packages/integrations/node/test/fixtures/trailing-slash/astro.config.mjs index 7ee28f213..acf78132b 100644 --- a/packages/integrations/node/test/fixtures/trailing-slash/astro.config.mjs +++ b/packages/integrations/node/test/fixtures/trailing-slash/astro.config.mjs @@ -2,7 +2,7 @@ import node from '@astrojs/node' export default { base: '/some-base', - output: 'hybrid', + output: 'static', trailingSlash: 'never', adapter: node({ mode: 'standalone' }) }; diff --git a/packages/integrations/node/test/fixtures/trailing-slash/package.json b/packages/integrations/node/test/fixtures/trailing-slash/package.json index cd543e583..9bea24872 100644 --- a/packages/integrations/node/test/fixtures/trailing-slash/package.json +++ b/packages/integrations/node/test/fixtures/trailing-slash/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/url/package.json b/packages/integrations/node/test/fixtures/url/package.json index 197599cb8..d2c038baf 100644 --- a/packages/integrations/node/test/fixtures/url/package.json +++ b/packages/integrations/node/test/fixtures/url/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/fixtures/well-known-locations/package.json b/packages/integrations/node/test/fixtures/well-known-locations/package.json index 7f3b212ea..f1fe33157 100644 --- a/packages/integrations/node/test/fixtures/well-known-locations/package.json +++ b/packages/integrations/node/test/fixtures/well-known-locations/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "^4.16.15", + "astro": "^5.0.0-alpha.8", "@astrojs/node": "workspace:*" } } diff --git a/packages/integrations/node/test/prerender-404-500.test.js b/packages/integrations/node/test/prerender-404-500.test.js index 86226c500..a7e968f0c 100644 --- a/packages/integrations/node/test/prerender-404-500.test.js +++ b/packages/integrations/node/test/prerender-404-500.test.js @@ -26,10 +26,6 @@ describe('Prerender 404', () => { root: './fixtures/prerender-404-500/', output: 'server', outDir: './dist/server-with-base', - build: { - client: './dist/server-with-base/client', - server: './dist/server-with-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -42,8 +38,7 @@ describe('Prerender 404', () => { after(async () => { await server.stop(); await fixture.clean(); - // biome-ignore lint/performance/noDelete: <explanation> - delete process.env.PRERENDER; + process.env.PRERENDER = undefined; }); it('Can render SSR route', async () => { @@ -117,10 +112,6 @@ describe('Prerender 404', () => { root: './fixtures/prerender-404-500/', output: 'server', outDir: './dist/server-without-base', - build: { - client: './dist/server-without-base/client', - server: './dist/server-without-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -133,8 +124,7 @@ describe('Prerender 404', () => { after(async () => { await server.stop(); await fixture.clean(); - // biome-ignore lint/performance/noDelete: <explanation> - delete process.env.PRERENDER; + process.env.PRERENDER = undefined; }); it('Can render SSR route', async () => { @@ -185,12 +175,8 @@ describe('Hybrid 404', () => { site: 'https://test.com/', base: '/some-base', root: './fixtures/prerender-404-500/', - output: 'hybrid', + output: 'static', outDir: './dist/hybrid-with-base', - build: { - client: './dist/hybrid-with-base/client', - server: './dist/hybrid-with-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -203,8 +189,7 @@ describe('Hybrid 404', () => { after(async () => { await server.stop(); await fixture.clean(); - // biome-ignore lint/performance/noDelete: <explanation> - delete process.env.PRERENDER; + process.env.PRERENDER = undefined; }); it('Can render SSR route', async () => { @@ -248,12 +233,8 @@ describe('Hybrid 404', () => { // from being reused site: 'https://test.net/', root: './fixtures/prerender-404-500/', - output: 'hybrid', + output: 'static', outDir: './dist/hybrid-without-base', - build: { - client: './dist/hybrid-without-base/client', - server: './dist/hybrid-without-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -266,8 +247,7 @@ describe('Hybrid 404', () => { after(async () => { await server.stop(); await fixture.clean(); - // biome-ignore lint/performance/noDelete: <explanation> - delete process.env.PRERENDER; + process.env.PRERENDER = undefined; }); it('Can render SSR route', async () => { diff --git a/packages/integrations/node/test/prerender.test.js b/packages/integrations/node/test/prerender.test.js index 0684ff63a..71137b76a 100644 --- a/packages/integrations/node/test/prerender.test.js +++ b/packages/integrations/node/test/prerender.test.js @@ -22,10 +22,6 @@ describe('Prerendering', () => { root: './fixtures/prerender/', output: 'server', outDir: './dist/with-base', - build: { - client: './dist/with-base/client', - server: './dist/with-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -98,10 +94,6 @@ describe('Prerendering', () => { root: './fixtures/prerender/', output: 'server', outDir: './dist/without-base', - build: { - client: './dist/without-base/client', - server: './dist/without-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -163,10 +155,6 @@ describe('Prerendering', () => { root: './fixtures/prerender/', output: 'server', outDir: './dist/via-integration', - build: { - client: './dist/via-integration/client', - server: './dist/via-integration/server', - }, adapter: nodejs({ mode: 'standalone' }), integrations: [ { @@ -225,10 +213,6 @@ describe('Prerendering', () => { root: './fixtures/prerender/', output: 'server', outDir: './dist/dev', - build: { - client: './dist/dev/client', - server: './dist/dev/server', - }, adapter: nodejs({ mode: 'standalone' }), }); devServer = await fixture.startDevServer(); @@ -273,12 +257,8 @@ describe('Hybrid rendering', () => { fixture = await loadFixture({ base: '/some-base', root: './fixtures/prerender/', - output: 'hybrid', + output: 'static', outDir: './dist/hybrid-with-base', - build: { - client: './dist/hybrid-with-base/client', - server: './dist/hybrid-with-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -347,12 +327,8 @@ describe('Hybrid rendering', () => { process.env.PRERENDER = false; fixture = await loadFixture({ root: './fixtures/prerender/', - output: 'hybrid', + output: 'static', outDir: './dist/hybrid-without-base', - build: { - client: './dist/hybrid-without-base/client', - server: './dist/hybrid-without-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -413,12 +389,8 @@ describe('Hybrid rendering', () => { fixture = await loadFixture({ root: './fixtures/prerender/', - output: 'hybrid', + output: 'static', outDir: './dist/hybrid-shared-modules', - build: { - client: './dist/hybrid-shared-modules/client', - server: './dist/hybrid-shared-modules/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); diff --git a/packages/integrations/node/test/trailing-slash.test.js b/packages/integrations/node/test/trailing-slash.test.js index 6f6a2a3ba..2a73efa75 100644 --- a/packages/integrations/node/test/trailing-slash.test.js +++ b/packages/integrations/node/test/trailing-slash.test.js @@ -21,13 +21,9 @@ describe('Trailing slash', () => { fixture = await loadFixture({ root: './fixtures/trailing-slash/', base: '/some-base', - output: 'hybrid', + output: 'static', trailingSlash: 'always', outDir: './dist/always-with-base', - build: { - client: './dist/always-with-base/client', - server: './dist/always-with-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -93,13 +89,9 @@ describe('Trailing slash', () => { fixture = await loadFixture({ root: './fixtures/trailing-slash/', - output: 'hybrid', + output: 'static', trailingSlash: 'always', outDir: './dist/always-without-base', - build: { - client: './dist/always-without-base/client', - server: './dist/always-without-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -168,13 +160,9 @@ describe('Trailing slash', () => { fixture = await loadFixture({ root: './fixtures/trailing-slash/', base: '/some-base', - output: 'hybrid', + output: 'static', trailingSlash: 'never', outDir: './dist/never-with-base', - build: { - client: './dist/never-with-base/client', - server: './dist/never-with-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -233,13 +221,9 @@ describe('Trailing slash', () => { fixture = await loadFixture({ root: './fixtures/trailing-slash/', - output: 'hybrid', + output: 'static', trailingSlash: 'never', outDir: './dist/never-without-base', - build: { - client: './dist/never-without-base/client', - server: './dist/never-without-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -301,13 +285,9 @@ describe('Trailing slash', () => { fixture = await loadFixture({ root: './fixtures/trailing-slash/', base: '/some-base', - output: 'hybrid', + output: 'static', trailingSlash: 'ignore', outDir: './dist/ignore-with-base', - build: { - client: './dist/ignore-with-base/client', - server: './dist/ignore-with-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); @@ -384,13 +364,9 @@ describe('Trailing slash', () => { fixture = await loadFixture({ root: './fixtures/trailing-slash/', - output: 'hybrid', + output: 'static', trailingSlash: 'ignore', outDir: './dist/ignore-without-base', - build: { - client: './dist/ignore-without-base/client', - server: './dist/ignore-without-base/server', - }, adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); |