* wip: revert sitemap PR * fix: extract SSR-ready "slug" helper to separate module * Un-revert sitemap PR. Not to blame! This reverts commit7cd2a8a5ea
. * fix: use .netlify for edge deployment test * refactor: add md file to edge function fixture * fix: add netlify edge tests to ci * chore: remove stray console log * wip: undo "dist" change on edge tests * chore: changeset * Revert "wip: undo "dist" change on edge tests" This reverts commit70e565ef06
. * temp: add ignore to breaking edge tests
25 lines
775 B
TypeScript
25 lines
775 B
TypeScript
// @ts-ignore
|
|
import { runBuild } from './test-utils.ts';
|
|
// @ts-ignore
|
|
import { assertEquals, assert, DOMParser } from './deps.ts';
|
|
|
|
// @ts-ignore
|
|
Deno.test({
|
|
// TODO: debug why build cannot be found in "await import"
|
|
ignore: true,
|
|
name: 'Edge Basics',
|
|
async fn() {
|
|
let close = await runBuild('./fixtures/edge-basic/');
|
|
const { default: handler } = await import('./fixtures/edge-basic/.netlify/edge-functions/entry.js');
|
|
const response = await handler(new Request('http://example.com/'));
|
|
assertEquals(response.status, 200);
|
|
const html = await response.text();
|
|
assert(html, 'got some html');
|
|
|
|
const doc = new DOMParser().parseFromString(html, `text/html`)!;
|
|
const div = doc.querySelector('#react');
|
|
assert(div, 'div exists');
|
|
|
|
await close();
|
|
},
|
|
});
|