Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ test('Should not hijack reply for a normal http request in the internal onError

const port = fastify.server.address().port

const httpClient = net.createConnection({ port: port }, () => {
const httpClient = net.createConnection({ port }, () => {
t.teardown(httpClient.destroy.bind(httpClient))

httpClient.write('GET / HTTP/1.1\r\n\r\n')
Expand Down Expand Up @@ -302,7 +302,7 @@ test('Should not hijack reply for an normal request to a websocket route that is

const port = fastify.server.address().port

const httpClient = net.createConnection({ port: port }, () => {
const httpClient = net.createConnection({ port }, () => {
t.teardown(httpClient.destroy.bind(httpClient))
httpClient.write('GET /echo HTTP/1.1\r\n\r\n')
httpClient.once('data', data => {
Expand Down
4 changes: 2 additions & 2 deletions test/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ test('Should invoke the correct handler depending on the headers', t => {

const port = fastify.server.address().port

const httpClient = net.createConnection({ port: port }, () => {
const httpClient = net.createConnection({ port }, () => {
httpClient.write('GET / HTTP/1.1\r\n\r\n')
httpClient.once('data', data => {
t.match(data.toString(), /hi from handler/i)
httpClient.end()
})
})

const wsClient = net.createConnection({ port: port }, () => {
const wsClient = net.createConnection({ port }, () => {
wsClient.write('GET / HTTP/1.1\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nSec-WebSocket-Version: 13\r\n\r\n')
wsClient.once('data', data => {
t.match(data.toString(), /hi from wsHandler/i)
Expand Down