fix: try to better handle directories and loading handlers both locally

and remotely
This commit is contained in:
Andy Burke 2025-06-24 12:06:09 -07:00
parent 5d25afc329
commit 5ee654f280
3 changed files with 10 additions and 8 deletions

View file

@ -16,13 +16,12 @@ Deno.test({
const old_handlers: string | undefined = Deno.env.get('SERVERUS_HANDLERS');
try {
Deno.chdir('./tests/www');
Deno.env.set(
'SERVERUS_HANDLERS',
`${path.join(path.dirname(path.resolve(path.fromFileUrl(import.meta.url))), 'handlers')}${
old_handlers ? (';' + old_handlers) : ''
}`
`${import.meta.resolve('./handlers')}${old_handlers ? (';' + old_handlers) : ''}`
);
Deno.chdir('./tests/www');
test_server_info = await get_ephemeral_listen_server();
const response = await fetch(`http://${test_server_info.hostname}:${test_server_info.port}/echo/hello_world.foo`, {