0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00
astro/packages/integrations/vercel/test/integration-assets.test.js
Matt Kane ef430a4238 fix(vercel): handle integration static assets in non-static sites (#516)
* fix: arrange assets for server output too

* Changeset

* Format
2025-01-23 11:13:45 +00:00

24 lines
1 KiB
JavaScript

import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';
describe('Assets generated by integrations', () => {
it('moves static assets generated by integrations to the correct location: static output', async () => {
const fixture = await loadFixture({
root: './fixtures/integration-assets/',
});
await fixture.build();
const sitemap = await fixture.readFile('../.vercel/output/static/sitemap-index.xml');
assert(sitemap.includes('<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'));
});
it('moves static assets generated by integrations to the correct location: server output', async () => {
const fixture = await loadFixture({
root: './fixtures/integration-assets/',
output: 'server',
});
await fixture.build();
const sitemap = await fixture.readFile('../.vercel/output/static/sitemap-index.xml');
assert(sitemap.includes('<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'));
});
});