Questions tagged [js-test-driver]

js-test-driver is an open source JavaScript unit tests runner written in Java.

Js-test-driver, a project started at Google, is able to run from command line and reports results to the standard output. As a result, it is possible to fully automate JavaScript tests and run them on a continuous integration server.

The goal of JsTestDriver is to build a JavaScript test runner which:

  • easily integrates with continuous builds systems and
  • allows running tests on multiple browsers quickly to ease TDD style development.

Project page

122 questions
4
votes
1 answer

generate jstestdriver coverage report

How can i generate an javascript test coverage using jstestdriver? I am able to run the javascript test using jstestdriver. I want to generate a coverage report to check how much percentage of javascript files i have tested. I have read through…
Jia-Luo
  • 3,023
  • 5
  • 16
  • 17
4
votes
2 answers

Where do I put HTML fixtures when I'm using JsTestDriver?

I'm having a hard time getting JSTD to load a fixture HTML file. My directory structure is: localhost/JsTestDriver.conf localhost/JsTestDriver.jar localhost/js/App.js localhost/js/App.test.js localhost/fixtures/index.html My conf file…
marclar
  • 3,026
  • 5
  • 35
  • 56
4
votes
3 answers

Considerations before doing test driven development

I'm starting to use test driven development for JavaScript, but I would like to start using it in my different projects. I would like to know what are the typical mistakes and how to avoid them? Also, I would like to know what I should read to make…
Siedrix
  • 641
  • 4
  • 10
4
votes
1 answer

How to make a unit test for ajax calls

I am a newbie in creating unit tests for JavaScripts. In my unit test I keep on getting "AssertError: expected "ok" but was [undefined] " as a result. Can any teach me how to do a unit test for ajax calls? Thanks. By the way, I'm using JsTestDriver…
4
votes
1 answer

Run Safari browser headlessly using xvfb on Mac

How do I run my jstestdriver test cases headlessly on Safari browser on OSX platform? I am able to achieve the same on Linux by using xvfb-run command. However, there is no such wrapper command available in OSX. I tried executing the following 2…
Maya
  • 95
  • 1
  • 3
  • 7
4
votes
1 answer

How to use asserts in callback function javascript

I have following code in test case: flickrJson.prototype.testFlickrPhotoSearch = function() { var wrongName = "googday"; var key = "3f807259749363aaa29c76012fa93945"; flickrPhotoSearch(wrongName, key, 1, handleData); } And handleData function: var…
user3115091
4
votes
1 answer

Run multiple specs using jasmine and jstestdriver

I have written multiple spec files for unit testing various modules on the webpage. If i run them individually, one at a time they work fine. But when i try to run all the files in a sequence, only the first file in the spec folder works while all…
Goontracker
  • 234
  • 1
  • 7
4
votes
1 answer

How I could test jquery animate functions like fadeTo, fadeOut with js-test-driver?

I was trying to write some test cases for my js functions, but I am facing an irritating issue. In my script there is a code section like: $("idOfTheDiv").fadeOut('fast'); or: $("idOfTheDiv").fadeTo('fast', 1); which works fine on my pages. The…
Iamisti
  • 1,680
  • 15
  • 30
4
votes
2 answers

JsTestDriver tests break after upgrading to 1.3.5

After upgrading to version 1.3.5 from 1.3.4 referencing an undefined variable causes the tests to fail. Any suggestions how to disable this behavior? I think its related to js strict mode, that it enables this by default, but cant find a way to…
VuesomeDev
  • 4,095
  • 2
  • 34
  • 44
4
votes
2 answers

Run Headless JsTestDriver?

Is there a way to use jsTestDriver in a headless state where it loads the browsers but does so headlessly (you can't see the browser) or it loads them minimized?
Levi Hackwith
  • 9,232
  • 18
  • 64
  • 115
4
votes
1 answer

JSTestDriver coverage eclipse plugin

I'm using JSTestDriver Eclipse plug-in and I want to install the coverage plugin: does anybody know how to get it working in Eclipse? thanks in advance Other things to note: I am under Win XP 64 bits, Eclipse version: Eclipse Java EE IDE for Web…
3
votes
1 answer

Unit testing self-invoking functions

I have a self-invoking function in a JavaScript file. Something like this: com.renderer = (function(){ render(data){ } .....other functions return{ init : function(){ $(document).ready(function(){ …
ChrisOdney
  • 6,066
  • 10
  • 38
  • 48
3
votes
1 answer

jsTestDriver + Nant = test directory issue

I am working on a project where the Javascript is becoming more complex, and needs to be tested as part of our automated build. Now I have got a project structure like shown below: - root |- build.xml |- tools |- js-test-driver |-…
3
votes
2 answers

Installing an Eclipse Plugin that you've compiled from Source?

I've successfully compiled js-test-driver plugin from source (http://js-test-driver.googlecode.com/svn/tags/1.2) and I am attempting to install it on Eclipse 3.5.1 Galileo. I understand how to install a plugin from an update site; I even…
leeand00
  • 25,510
  • 39
  • 140
  • 297
3
votes
0 answers

What constitutes reasonable unit testing of a web application's interface?

We have a large web application in my office and we have a relatively large testing framework in place for the codebase (jsdriver and mocha). I'm pretty happy having a lot of the code tested (modules for web queries, controllers, etc.), but we have…
voodoogiant
  • 2,118
  • 6
  • 29
  • 49
1
2
3
8 9