From 42480907ade846d05510b1c822e29fb66e29691e Mon Sep 17 00:00:00 2001 From: Angel Mendez Date: Thu, 30 Nov 2023 14:45:19 -0600 Subject: [PATCH] refactor: replace got with node-fetch on dev-miscellaneous.test.js related to #5695 --- tests/integration/commands/dev/dev-miscellaneous.test.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/integration/commands/dev/dev-miscellaneous.test.js b/tests/integration/commands/dev/dev-miscellaneous.test.js index 6700aa299f3..17cbb5ed93a 100644 --- a/tests/integration/commands/dev/dev-miscellaneous.test.js +++ b/tests/integration/commands/dev/dev-miscellaneous.test.js @@ -8,7 +8,6 @@ import fetch from 'node-fetch' import { describe, test } from 'vitest' import { withDevServer } from '../../utils/dev-server.ts' -import got from '../../utils/got.js' import { withMockApi } from '../../utils/mock-api.js' import { pause } from '../../utils/pause.js' import { withSiteBuilder } from '../../utils/site-builder.ts' @@ -739,7 +738,7 @@ describe.concurrent('commands/dev-miscellaneous', () => { await builder.buildAsync() await withDevServer({ cwd: builder.directory }, async ({ port }) => { - const helloWorldMessage = await got(`http://localhost:${port}/hello`).then((res) => res.body) + const helloWorldMessage = await fetch(`http://localhost:${port}/hello`).then((res) => res.text()) await builder .withEdgeFunction({ @@ -751,7 +750,7 @@ describe.concurrent('commands/dev-miscellaneous', () => { const DETECT_FILE_CHANGE_DELAY = 500 await pause(DETECT_FILE_CHANGE_DELAY) - const helloBuilderMessage = await got(`http://localhost:${port}/hello`).then((res) => res.body) + const helloBuilderMessage = await fetch(`http://localhost:${port}/hello`, {}).then((res) => res.text()) t.expect(helloWorldMessage).toEqual('Hello world') t.expect(helloBuilderMessage).toEqual('Hello builder')