Skip to content

Commit

Permalink
chore: correcting README example for testing (#305)
Browse files Browse the repository at this point in the history
Using correct variable instead of variable that didn't exist

Signed-off-by: Clint Goodman <cgood92@users.noreply.github.com>
  • Loading branch information
cgood92 authored Oct 23, 2024
1 parent c0408dc commit cca4fea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const FastifyWebSocket = require('@fastify/websocket')
const ws = require('ws')

const fastify = Fastify()
await fastify.register(websocket)
await fastify.register(FastifyWebSocket)

fastify.get('/', { websocket: true }, (socket, req) => {
const stream = ws.createWebSocketStream(socket, { /* options */ })
Expand Down Expand Up @@ -332,6 +332,7 @@ test('connect to /', async (t) => {
const fastify = Fastify()
fastify.register(App)
t.teardown(fastify.close.bind(fastify))
await fastify.ready()

const ws = await fastify.injectWS('/', {headers: { "api-key" : "some-random-key" }})
let resolve;
Expand Down

0 comments on commit cca4fea

Please sign in to comment.