4

I'm writing an html/js (ember) chat app using socket.io as the backend. (I know: original, much?)

For some of my end to end integration tests (i.e. Client AND Server) I would like to test the interaction between two clients. I know I can get this done with selenium-webdriver and a testing framework such as mocha but I'd really like to use a nice test runner like Karma or the one that comes with QUnit and I'm a bit stumped as to how to get either of those to create and interact with two clients at once.

Andrew
  • 698
  • 5
  • 13

1 Answers1

1

QUnit in itself is not a test runner. It is a testing framework. Karma on the other hand, is a test runner.

QUnit very much likes to test units of code, just as any xUnit framework does. Running integration tests in unit-testing settings is not advisable. As the comment below from Andy clearly demonstrates, QUnit can be used in different settings, but there not in the sense of an xUnit-type testing framework.

As for testing socket.io applications, this SO answer might be helpful to you?

Swizec Teller has a tutorial on testing socket.io code, and Liam Kaufman has a blog post on testing a chat application written with socket.io.

Community
  • 1
  • 1
Steen
  • 6,573
  • 3
  • 39
  • 56
  • Sorry for the misleading text in my question. QUnit does come with a nice in-browser test runner though. The links to the tutorials are great but I was really looking for a way to do end to end integration testing but testing with socket.io-client bypasses the browser part of the loop. If you feel quinit is unsuitable for testing you may want to have a little word with the guys who write ember.js http://emberjs.com/guides/testing/integration/ – Andrew Sep 26 '13 at 08:27
  • @Andy: I really like qunit for *unit*-testing, using it on a daily basis. I just don't think it's suitable for integration testing. Given your comments, perhaps you should update the question to better describe your goals with the setup? – Steen Sep 26 '13 at 08:58
  • Edited for clarity but again, while _you_ feel that QUnit is only suitable for unit testing, others, including people who work on Ember.js and so presumably know their stuff, clearly disagree as evinced by the article I linked. – Andrew Sep 26 '13 at 11:53
  • Allright, I have in turn edited my answer to clarify my understanding of xUnit frameworks in the context of this page. Thanks for bothering with argumenting this point of view. On a side note, I would never try to question that people who have accomplished working software are able to accomplish working software, it's just that I'm too old to keep up with the fashions and the shifting use of words. – Steen Sep 29 '13 at 20:30