---
title: "Discussion on \"Testing a component that uses WebSockets, without a real server\" | Hashnode"
description: "Discussion on \"Testing a component that uses WebSockets, without a real server\". A component that talks to a REST API is easy to test. You mock the HTTP call, resolve it with fixture data, assert on the render. A component that talks to a WebSocket is a different animal, and most"
url: "https://hashnode.com/posts/testing-a-component-that-uses-websockets-without-a-real-server/6aaae6cbe4cde8d067097011"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Testing a component that uses WebSockets, without a real server](https://101beardo.hashnode.dev/testing-a-component-that-uses-websockets-without-a-real-server?utm_source=hashnode&utm_medium=feed)

A component that talks to a REST API is easy to test. You mock the HTTP call, resolve it with fixture data, assert on the render. A component that talks to a WebSocket is a different animal, and most

Sep 16 · 4 min read · 101beardo.hashnode.dev  
Read the article

-   [#react-js](https://hashnode.com/tag/react-js)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Tarun Sharma](https://hashnode.com/@101beardo)

@101beardo · Bengaluru, India

  
[View profile](https://hashnode.com/@101beardo)

React.js Frontend Web Developer | Next.js Specialist

3 years of experience building production SaaS platforms, enterprise web apps, and cross-platform mobile apps using React.js, Next.js, and TypeScript.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
