Tagged Questions
2
votes
1answer
118 views
Advise how to write a simple test for this javascript snippet?
I'm trying to start unit testing (not using any testing frameworks) for my javascripts.
Here's one example of it.
var obj = {};
obj.disableBtn = function ($btn, style) {
...
2
votes
2answers
203 views
JavaScript…what to unit test
I would like to hear other people's opinion on what to unit test in JavaScript. I've been thinking about it and experimenting and let me present what seems to me the right thing. First of all, in ...
2
votes
2answers
190 views
In javascript and other languages which lack a compiler, is unit testing a good method to ensure correct syntax and variable naming?
I've been working on a medium sized web application that makes very heavy use of javascript. I tend to introduce common errors per 10 lines of code with either an unknown variable name or function ...
5
votes
2answers
2k views
How do you handle measuring Code Coverage in JavaScript
In order to measure Code Coverage for JavaScript unit tests, one needs to instrument the code, run the tests and then perform post-processing.
My concern is that, as a result, you are unit testing ...
8
votes
3answers
580 views
What should be tested in Javascript?
At work, we've just started on a heavily Javascript based application (actually using Coffeescript, but still), of which I've been implementing an automated test system using JsTestDriver and fabric.
...
2
votes
2answers
258 views
How do you manage your javascript unit tests?
When you are writing JavaScript unit tests, where do you put all the test code?
I see two potential approaches:
Leave all your test code with your regular web project and explictly don't release ...
1
vote
1answer
96 views
When writing tests for a Wordpress plugin, should i run them inside wordpress or in a normal browser?
I have started using BDD for a wordpress plugin i'm working on and i'm rewriting the js codebase to do tests. I've encountered a few problems but i'm going steady now, i was wondering if i had the ...
5
votes
5answers
408 views
How does one unit test an algorithm
I was recently working on a JS slideshow which rotates images using a weighted average algorithm. Thankfully, timgilbert has written a weighted list script which implements the exact algorithm I ...
2
votes
2answers
962 views
Using JSTestdriver to test UI/DOM?
Can JSTestDriver be used to test DOM behaviors and interactions?
I see I can write tests to exercise pure JS but how do I go about testing against HTML or DOM?
Can I deliver with each test HTML for ...
2
votes
3answers
1k views
Can I test effectively javascript functions with a PHP unit-testing framework?
If I want to unit-test some of my javascript functions, would it be more efficient (and doable) to use the already installed PHP unit-testing framework, or should I use a javascript unit-testing ...