Skip to content

Commit

Permalink
tests: update other tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
DTrombett committed Nov 21, 2024
1 parent a070253 commit bc4cbac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/redirect-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ for (const factory of [

t.strictEqual(statusCode, 200)
t.ok(!headers.location)
t.strictEqual(body, `POST /5 :: host@${server} connection@keep-alive content-length@7 :: REQUEST`)
t.strictEqual(body, `GET /5 :: host@${server} connection@keep-alive`)
})

test('should follow redirection after a HTTP 302', async t => {
Expand Down Expand Up @@ -485,7 +485,7 @@ for (const factory of [
const server = await startRedirectingServer()

const { statusCode, headers, body: bodyStream } = await request(t, server, undefined, `http://${server}/301`, {
method: 'POST',
method: 'PUT',
body: createReadableStream('REQUEST'),
maxRedirections: 10
})
Expand Down Expand Up @@ -541,7 +541,7 @@ test('should follow redirections when going cross origin', async t => {
`http://${server3}/end`,
`http://${server1}/end`
])
t.strictEqual(body, 'POST')
t.strictEqual(body, 'GET')

await t.completed
})
Expand Down
6 changes: 3 additions & 3 deletions test/redirect-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test('should follow redirection after a HTTP 300', async t => {
t.strictEqual(body.join(''), `GET /5 key=value :: host@${server} connection@keep-alive`)
})

test('should follow redirection after a HTTP 301', async t => {
test('should follow redirection after a HTTP 301 changing method to GET', async t => {
t = tspl(t, { plan: 3 })

const body = []
Expand All @@ -97,7 +97,7 @@ test('should follow redirection after a HTTP 301', async t => {
}
)

t.strictEqual(body.join(''), `POST /5 :: host@${server} connection@keep-alive content-length@7 :: REQUEST`)
t.strictEqual(body.join(''), `GET /5 :: host@${server} connection@keep-alive`)
})

test('should follow redirection after a HTTP 302', async t => {
Expand Down Expand Up @@ -316,7 +316,7 @@ test('should follow redirections when going cross origin', async t => {
}
)

t.strictEqual(body.join(''), 'POST')
t.strictEqual(body.join(''), 'GET')
})

describe('when a Location response header is NOT present', async () => {
Expand Down

0 comments on commit bc4cbac

Please sign in to comment.