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
…6235)

related to #5695

Co-authored-by: Sarah Etter <[email protected]>
Co-authored-by: Mateusz Bocian <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored May 17, 2024
1 parent 51f1cf6 commit 5c49780
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 @@ -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'
Expand Down Expand Up @@ -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({
Expand All @@ -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')
Expand Down

1 comment on commit 5c49780

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,359
  • Package size: 313 MB
  • Number of ts-expect-error directives: 980

Please sign in to comment.