Skip to content

Commit

Permalink
refactor: replace got with node-fetch on dev-miscellaneous.test.js
Browse files Browse the repository at this point in the history
related to #5695
  • Loading branch information
hereje committed Nov 30, 2023
1 parent d37ec4b commit 4248090
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/integration/commands/dev/dev-miscellaneous.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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({
Expand All @@ -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')
Expand Down

0 comments on commit 4248090

Please sign in to comment.