0
votes
0answers
59 views

What is a good method of storing test data for development and unit testing with angular and jasmine?

What is a good method of storing JSON data/objects for development and unit testing with angular and jasmine? I have seen some ways of accomplishing this. However, since I am new to unit testing with ...
11
votes
4answers
650 views

Is there a better way of writing unit tests than a series of 'AssertEquals'?

Here's a basic example of what my unit test needs to be, using qunit: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> ...
2
votes
2answers
247 views

How do I integrate a browser-based JavaScript unit testing framework into my workflow?

I'm wondering how I seamlessly include a JavaScript unit testing framework into my workflow. The context is, we have an existing data processing algorithm + webapp to display it, with no automated ...
4
votes
1answer
3k views

How do I decide what testing framework to use?

The situation is this. I'm a junior developer for a small government IT project. We don't have anything of continuous integration or a automated testing framework. But the idea is to be developing ...
3
votes
2answers
239 views

Unit Testing of JavaScript - Are we testing the logic of the code or the behavior against a browser

[Warning]: I am new to the whole unit testing and have been trying to learn as much as possible. I am working on a MS CRM 2011 project and I have been trying to introduce unit testing in my company. ...
3
votes
2answers
262 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) { ...
1
vote
2answers
309 views

JavaScript…what to unit test [duplicate]

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
368 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 ...
5
votes
2answers
3k 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 ...
1
vote
1answer
131 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
673 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
204 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 ...
8
votes
3answers
732 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. ...
10
votes
2answers
415 views

How do you unit test your javascript

I spend a lot of time working in javascript of late. I have not found a way that seems to work well for testing javascript. This in the past hasn't been a problem for me since most of the websites I ...
2
votes
2answers
1k 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
2k 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 ...