From 5c4978051c1e666c2074bc935a53af35ca7c5f30 Mon Sep 17 00:00:00 2001 From: Angel Mendez Date: Fri, 17 May 2024 07:29:48 -0600 Subject: [PATCH] refactor: replace got with node-fetch on dev-miscellaneous.test.js (#6235) related to #5695 Co-authored-by: Sarah Etter Co-authored-by: Mateusz Bocian Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- 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 67993337f4b..21d8e24d62e 100644 --- a/tests/integration/commands/dev/dev-miscellaneous.test.js +++ b/tests/integration/commands/dev/dev-miscellaneous.test.js @@ -12,7 +12,6 @@ import { describe, test } from 'vitest' import { cliPath } from '../../utils/cli-path.js' import { getExecaOptions, 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' @@ -779,7 +778,7 @@ describe.concurrent('commands/dev-miscellaneous', () => { await builder.build() 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({ @@ -791,7 +790,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')