From 72f56859ceff045fa03af075612759d1dbc68c46 Mon Sep 17 00:00:00 2001 From: Kunal Kundu Date: Sun, 1 Jan 2023 00:06:52 +0530 Subject: [PATCH] fix: update test response, fix path resolution --- src/commands/dev/dev.mjs | 3 ++- tests/integration/100.command.dev.test.cjs | 2 +- tests/integration/500.command.dev.test.cjs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/dev/dev.mjs b/src/commands/dev/dev.mjs index 7fecaa2b133..6162d008222 100644 --- a/src/commands/dev/dev.mjs +++ b/src/commands/dev/dev.mjs @@ -1,5 +1,6 @@ // @ts-check import events from 'events' +import path from 'path' import process from 'process' import fastifyStatic from '@fastify/static' @@ -56,7 +57,7 @@ const netlifyBuildPromise = import('@netlify/build') const startStaticServer = async ({ settings }) => { const server = Fastify() server.register(fastifyStatic, { - root: settings.dist, + root: path.resolve(settings.dist), // eslint-disable-next-line no-unused-vars setHeaders: (res, _path, _stat) => { res.setHeader('X-Powered-by', 'netlify-dev') diff --git a/tests/integration/100.command.dev.test.cjs b/tests/integration/100.command.dev.test.cjs index 39b4cd6ad34..f1ce6a11d76 100644 --- a/tests/integration/100.command.dev.test.cjs +++ b/tests/integration/100.command.dev.test.cjs @@ -670,7 +670,7 @@ test('should detect deleted edge functions', async (t) => { ) t.is(authResponseMessage, 'Auth response') - t.is(authNotFoundMessage, 'Not Found') + t.is(authNotFoundMessage, '404 Not Found') }) }) }) diff --git a/tests/integration/500.command.dev.test.cjs b/tests/integration/500.command.dev.test.cjs index d7210173b1e..9cbe348a7c3 100644 --- a/tests/integration/500.command.dev.test.cjs +++ b/tests/integration/500.command.dev.test.cjs @@ -166,7 +166,7 @@ test('should handle form submission with a background function', async (t) => { }) }) -test.only('should not handle form submission when content type is `text/plain`', async (t) => { +test('should not handle form submission when content type is `text/plain`', async (t) => { await withSiteBuilder('site-with-form-text-plain', async (builder) => { builder .withContentFile({