From cca4feaa4816e2a82fabe6c08dde3ddff6cab6d1 Mon Sep 17 00:00:00 2001 From: Clint Goodman Date: Wed, 23 Oct 2024 14:39:32 -0600 Subject: [PATCH] chore: correcting README example for testing (#305) Using correct variable instead of variable that didn't exist Signed-off-by: Clint Goodman --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d4a17b0..3c5ae10 100644 --- a/README.md +++ b/README.md @@ -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 */ }) @@ -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;