Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Provide a WebSocket mocking service. #3

Open
baalexander opened this issue Feb 4, 2014 · 4 comments
Open

Provide a WebSocket mocking service. #3

baalexander opened this issue Feb 4, 2014 · 4 comments

Comments

@baalexander
Copy link

It would be awesome if there was something like $httpBackend for mocking WebSocket calls. It looks like you've already started the process with WSMock in your spec file.

Functionality that would be nice:

  • Flushing WS calls
  • Faking WS responses
  • Ability to spy if .send was called and check what was being sent
@jeffbcross
Copy link
Contributor

Good call

@jeffbcross
Copy link
Contributor

I created a base mock module and backend service in this commit, LMK what you think: beac73e

Your first and third bullets are satisfied with the current implementation, but not the 2nd bullet yet.

@baalexander
Copy link
Author

This looks good, thanks!

For spying on send calls, is the idea I would inspect pendingSends after calling MockWebSocket's .send()?

@begriffs
Copy link
Contributor

begriffs commented Jul 8, 2014

Looking forward to being able to fake responses from ngSocketBackend. Any plans to add this in the near future?

begriffs added a commit to begriffs/angular-patience that referenced this issue Jul 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants