0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/integrations/netlify/test/edge-functions/root-dynamic.test.ts
2023-07-03 20:59:43 +08:00

19 lines
631 B
TypeScript

import { loadFixture } from './test-utils.ts';
import { assertEquals } from './deps.ts';
Deno.test({
// TODO: debug why build cannot be found in "await import"
ignore: true,
name: 'Assets are preferred over HTML routes',
async fn() {
const fixture = loadFixture('./fixtures/root-dynamic/');
await fixture.runBuild();
const { default: handler } = await import(
'./fixtures/root-dynamic/.netlify/edge-functions/entry.js'
);
const response = await handler(new Request('http://example.com/styles.css'));
assertEquals(response, undefined, 'No response because this is an asset');
await fixture.cleanup();
},
});