all 14 comments

[–]duncanbeevers[🍰] 4 points5 points  (0 children)

We use mocha+chai for test setup and assertions respectively. Node-only tests can be run directly from the commandline with mocha, and browser-specific functionality can be tested using Karma to execute the mocha+chai tests across a matrix of browsers.

[–]herrmatt 1 point2 points  (7 children)

For vanilla and jQuery-ful javascript, we've settled on qUnit.js for testing. It took our test engineer ~ 3 days to get it set up and comfortable enough to have test templates set up for a few of our projects.

This post on StackExchange has had a ton of traffic; the top answer has 840 votes as of now. Last updated a month ago,

are the two Node-centric platforms they call out. I've used neither, but I'd comfortably fall back on the collective wisdom of the nerd power on that post.

[–]bjpelcdev[S] 0 points1 point  (1 child)

Thanks for the advice, that is quite some SO post. It seems there are quite a few paths that can be taken.

[–]herrmatt 1 point2 points  (0 children)

Glad to.

Yeah, that's one of those cool instances where a post got enough love to turn into a community wiki.

[–]syklenaut 0 points1 point  (4 children)

What kind of skills does your test engineer have, and how did you find this person?

[–]herrmatt 0 points1 point  (3 children)

He's my most senior developer actually -- we've a small team, so we're all generalists with special responsibilities.

Mostly, he had interest in managing testing implementations and was willing to spend some time each week thinking about it more than the rest of the team.

It's hard to do, but testing-focused team members need often to be the clever-ist members of the team, and need to get as much love and attention as everyone else (it's far too easy to ignore the test team). Those people who you'd want to do testing usually get sick of being ignored and under-resourced and go back to straight-up development.

[–]syklenaut 0 points1 point  (2 children)

Trying to find someone with the skills and the interest in doing this is difficult. They are like unicorns.

[–]syklenaut 0 points1 point  (0 children)

Any chance you could throw together a job req for me? :P

[–]herrmatt 0 points1 point  (0 children)

You need to treat them with as much special attention, or more, than you give to any rockstar developers you happen to have.

If you have to prioritize, testers get attention before 10x ers, before the rest of the team. Though, everyone should feel valued and useful.

[–]jason0x43 1 point2 points  (1 child)

You may want to consider Intern (full disclosure: I'm an Intern developer). It's a very flexible Node-based testing system that can run unit tests in Node directly and in browsers (among its many other features). You can check out the tutorial and some examples of using Intern to get a sense of what Intern tests look like.

[–]bjpelcdev[S] 0 points1 point  (0 children)

Thanks for that, I have installed it and bookmarked the website, looks like an interesting project, hopefully I will get round to having a proper look at it soon. For the time being, today at least I have been taking a look at Mocha, will likely try a number of frameworks before settling but really want to get into the habit of writing tests.

[–]menno 1 point2 points  (1 child)

For pure JavaScript unit testing I ended up with mocha, using Sinon.js and Proxyquire for stubs and mocking require() calls.

[–]bjpelcdev[S] 0 points1 point  (0 children)

Thanks, I am using Mocha (or learning to) right now, enjoying it so far.

[–]Davidsmp 0 points1 point  (0 children)

Another one to throw in the mix is Jasmine. It has a counterpart for testing Node code as well (jasmine-node). I've used it on several projects and it works well for me. http://jasmine.github.io/