Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples of using this in Ember tests? #2

Open
jamesdixon opened this issue Jul 23, 2015 · 2 comments
Open

Examples of using this in Ember tests? #2

jamesdixon opened this issue Jul 23, 2015 · 2 comments

Comments

@jamesdixon
Copy link

Hi,

First off, thanks for turning this into an Ember CLI addon! Appreciated.

Second, do you have any examples of how you're using this in your Ember tests? I'm fairly new to testing and struggling with this a bit.

Thanks!
James

@yratanov
Copy link
Owner

Hi @jamesdixon. It is actually just a wrapper for bower package so:

I add a test helper:

Ember.Test.registerHelper 'stubWebSocket', (app, url)->
  window.WebSocket = MockSocket
  new MockServer(url)

then in tests

webSocketServer = stubWebSocket(user.get('id'))
webSocketServer.send(message)
andThen ->
  assertPageIncludes 'Something on the page after message received'

Sorry for coffeescript, but I think you get the idea.

@Mawaheb
Copy link

Mawaheb commented Jul 28, 2015

Could you please be kind and link/add some more tests examples? I am as well finding it difficult to get my tests running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants