Skip to content

Commit

Permalink
chore(README): Improve wording
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Jun 26, 2021
1 parent 40164d1 commit a6ad1f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ npm install @relaycorp/ws-mock

## Using the mock client

You should initialise `MockClient` by passing the `ws` server to be tested and then call `client.connect()` to initiate the connection. From that point you can interact with the server. For example:
You'd use a mock client when you need to test a server. You should initialise `MockClient` by passing the `ws` server to be tested and then call `client.connect()` to initiate the connection. From that point you can interact with the server. For example:

```javascript
test('Challenge should be sent as soon as client connects', async () => {
Expand All @@ -26,7 +26,7 @@ You'll find real-world examples in [relaycorp/relaynet-internet-gateway](https:/

## Using the mock server

You basically need to initialise `MockServer` and replace the default export from `ws` with a mock WebSocket. Here's an example with Jest:
You'd use a mock server when you need to test a client. You basically need to initialise `MockServer` and replace the default export from `ws` with a mock WebSocket. Here's an example with Jest:

```javascript
let mockServer: MockServer;
Expand Down

0 comments on commit a6ad1f4

Please sign in to comment.