Use stub image service for tests (#7376)

This commit is contained in:
Bjorn Lu 2023-06-13 22:47:24 +08:00 committed by GitHub
parent 1c7b635956
commit 3e1fbc2c8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 22 deletions

View file

@ -1,15 +1,19 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import react from '@astrojs/react' import react from '@astrojs/react';
import { testImageService } from '../../test-image-service.js';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
// test custom base to make sure things work // test custom base to make sure things work
base: '/custom-base', base: '/custom-base',
integrations: [react()], integrations: [react()],
build: { build: {
assetsPrefix: 'http://localhost:4321' assetsPrefix: 'http://localhost:4321',
}, },
experimental: { experimental: {
assets: true assets: true,
} },
image: {
service: testImageService(),
},
}); });

View file

@ -1,8 +1,12 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import { testImageService } from '../../test-image-service.js';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
experimental: { experimental: {
assets: true assets: true,
}, },
image: {
service: testImageService(),
},
}); });

View file

@ -1,10 +1,14 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import markdoc from '@astrojs/markdoc'; import markdoc from '@astrojs/markdoc';
import { testImageService } from '../../../../../astro/test/test-image-service.js';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
experimental: { experimental: {
assets: true, assets: true,
}, },
image: {
service: testImageService(),
},
integrations: [markdoc()], integrations: [markdoc()],
}); });

View file

@ -1,8 +1,12 @@
import mdx from '@astrojs/mdx'; import mdx from '@astrojs/mdx';
import { testImageService } from '../../../../../astro/test/test-image-service.js';
export default { export default {
integrations: [mdx()], integrations: [mdx()],
experimental: { experimental: {
assets: true assets: true,
} },
image: {
service: testImageService(),
},
} }

View file

@ -1,9 +1,13 @@
import vercel from '@astrojs/vercel/static'; import vercel from '@astrojs/vercel/static';
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import { testImageService } from '../../../../../astro/test/test-image-service.js';
export default defineConfig({ export default defineConfig({
adapter: vercel({imageService: true}), adapter: vercel({imageService: true}),
experimental: { experimental: {
assets: true assets: true,
} },
image: {
service: testImageService(),
},
}); });

View file

@ -1,9 +1,6 @@
import vercel from '@astrojs/vercel/static';
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/static';
export default defineConfig({ export default defineConfig({
adapter: vercel({imageService: true}), adapter: vercel(),
experimental: {
assets: true
}
}); });