Skip to content

Commit cca4fea

Browse files
authored
chore: correcting README example for testing (#305)
Using correct variable instead of variable that didn't exist Signed-off-by: Clint Goodman <[email protected]>
1 parent c0408dc commit cca4fea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ const FastifyWebSocket = require('@fastify/websocket')
271271
const ws = require('ws')
272272

273273
const fastify = Fastify()
274-
await fastify.register(websocket)
274+
await fastify.register(FastifyWebSocket)
275275

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

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

0 commit comments

Comments
 (0)