Skip to content

Commit

Permalink
Merge branch 'netlify:main' into refactor/replace-got/dev-miscellaneo…
Browse files Browse the repository at this point in the history
…us.test.js
  • Loading branch information
hereje authored Dec 13, 2023
2 parents 54c995d + 8834fbc commit ec7042e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/integration/commands/dev/v2-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { gte } from 'semver'
import { describe, expect, test } from 'vitest'

import { FixtureTestContext, setupFixtureTests } from '../../utils/fixture.js'
import got from '../../utils/got.js'

const siteInfo = {
account_id: 'mock-account-id',
Expand All @@ -26,16 +25,13 @@ const setup = async ({ fixture }) => {
await execa('npm', ['install'], { cwd: fixture.directory })
}

describe.runIf(gte(version, '18.13.0'))('v2 api', () => {
describe.runIf(gte(version, '18.13.0')).concurrent('v2 api', () => {
setupFixtureTests('dev-server-with-v2-functions', { devServer: true, mockApi: { routes }, setup }, () => {
test<FixtureTestContext>('should successfully be able to run v2 functions', async ({ devServer }) => {
const response = await got(`http://localhost:${devServer.port}/.netlify/functions/ping`, {
throwHttpErrors: false,
retry: { limit: 0 },
})
const response = await fetch(`http://localhost:${devServer.port}/.netlify/functions/ping`)

expect(response.statusCode).toBe(200)
expect(response.body).toBe('pong')
expect(response.status).toBe(200)
expect(await response.text()).toBe('pong')
})

test<FixtureTestContext>('supports streamed responses', async ({ devServer }) => {
Expand Down

0 comments on commit ec7042e

Please sign in to comment.