2023-03-07 13:41:24 +00:00
|
|
|
// @ts-expect-error
|
2022-04-22 14:03:25 +00:00
|
|
|
import { runBuild } from './test-utils.ts';
|
2023-03-07 13:41:24 +00:00
|
|
|
// @ts-expect-error
|
2022-04-22 14:03:25 +00:00
|
|
|
import { assertEquals, assert, DOMParser } from './deps.ts';
|
|
|
|
|
2023-03-07 13:41:24 +00:00
|
|
|
// @ts-expect-error
|
2022-04-22 14:03:25 +00:00
|
|
|
Deno.test({
|
2022-06-17 00:31:08 +00:00
|
|
|
// TODO: debug why build cannot be found in "await import"
|
|
|
|
ignore: true,
|
2022-04-22 14:03:25 +00:00
|
|
|
name: 'Assets are preferred over HTML routes',
|
|
|
|
async fn() {
|
|
|
|
let close = await runBuild('./fixtures/root-dynamic/');
|
2022-04-22 14:04:54 +00:00
|
|
|
const { default: handler } = await import(
|
2022-06-17 00:31:08 +00:00
|
|
|
'./fixtures/root-dynamic/.netlify/edge-functions/entry.js'
|
2022-04-22 14:04:54 +00:00
|
|
|
);
|
2022-04-22 14:03:25 +00:00
|
|
|
const response = await handler(new Request('http://example.com/styles.css'));
|
|
|
|
assertEquals(response, undefined, 'No response because this is an asset');
|
|
|
|
await close();
|
|
|
|
},
|
|
|
|
});
|