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
2
votes
2 answers

JSTestDriver concurrent tests

I've been evaluating JSTestDriver, and it seems to be working well. I want to use it in a continuous integration environment, and I want to know if multiple projects can be testing against the same JSTestDriver server at the same time. So my…
Jeff Storey
  • 56,312
  • 72
  • 233
  • 406
2
votes
0 answers

Eunning JsTestDriver server from Eclipse plugin

I have eclipse Juno (a new install) and installed the JsTestDriver plugin 1.3.4.e. I have one project, sandbox, with src, lib, and src-test directories; I have JsTestDriver's example files: Greeter.js in src, GreeterTest.js in src-test. My…
arcy
  • 12,845
  • 12
  • 58
  • 103
2
votes
1 answer

Correct syntax for setUp function for JSTestDriver

Eclipse Juno Service Release 1 Example of a working Unit Test ... InRangeTest = TestCase("InRangeTest"); InRangeTest.prototype.test01 = function() { var ir = new InRange(0.0, "<", Number.MAX_VALUE, "≤"); …
Extermiknit
  • 153
  • 1
  • 2
  • 12
2
votes
1 answer

how to add mocha jstestdriver to webstorm

I'd like to use the built-in JsTestDriver functionality and code coverage support of the WebStorm IDE. However, I use mocha instead of Jasmine. How can I configure webstorm to recognize mocha, or use a mocha plugin? I did find this piece of code to…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
2
votes
1 answer

Using JsTestDriver's basePath to specify where to load fixture data from

I am trying to load HTML fixture data into a JsTestDriver test environment. I can get it to work when the jsTestDriver.conf file is at the top level of my working directory, but I cannot get it to work if I put it in a subdirectory and try to use…
quux00
  • 13,679
  • 10
  • 57
  • 69
2
votes
1 answer

Writing testable JavaScript code

I'm starting to delve into some work with JavaScript and i'm trying to get a feel for how I should be writing testable JS code. My background is primarily Java which i'm quite comfortable with but I have no JavaScript experience. after some reading,…
RandomUser
  • 4,140
  • 17
  • 58
  • 94
2
votes
0 answers

Why would JsTestDriver create a second instance of browser?

I open FireFox and go to the capture URL ( localhost:9876/capture by default ). I then run my jasmine tests via jstestdriver. The output that says: setting runnermode QUIET Firefox: Reset Firefox: Reset ... Total 3 tests (Passed: 3; Fails: 0;…
Dan Chan
  • 494
  • 4
  • 14
2
votes
2 answers

Exclude dependencies from JS Test Driver code coverage

In my JS Test Driver configuration file, I'm excluding unit tests from code coverage calculation by putting them under test instead of load. However, I can't do this for dependencies, like jQuery of Underscore.js, since they need to be loaded before…
Travis Watson
  • 1,729
  • 1
  • 18
  • 25
2
votes
2 answers

Require.JS and JS Test Driver: Unexpected token <

I am trying to test a simple Backbone Model loaded via RequireJS: define ["backbone"], (Backbone)-> class Todo extends Backbone.Model defaults: title: '' priority: 0 done: false validate:…
jm2
  • 763
  • 2
  • 13
  • 27
2
votes
1 answer

Can JStestDriver be used to test js code within JSP files?

Quick question: It is possible to do unit testing, particularly with JStestDriver, on Javascript code written inside JSP files? Or I have to necessarily extract it into external js files?
2
votes
1 answer

JStestDriver assertEquals ("000011",11) shouldn't be false?

I expected that JSTD treated "000011" (string) as not equal to 11 (number). But, taking a look at he actual JSTD code, assertEquals returns (a === e) only if one of the elements are Objects, otherwise returns (a == e) isn't this wrong?
Pierpaolo
  • 567
  • 3
  • 7
  • 17
1
vote
1 answer

How to Unit-Test JavaScript immediate functions with Jasmine / Chutzpah / JsTestDriver

We have an immediate function in the file 'mediator.js' which adds a 'mediator' object to the global namespace. This 'mediator' is the only global object we have. Now we have many different unit-tests for the 'mediator' object. And we want each test…
GarethOwen
  • 6,075
  • 5
  • 39
  • 56
1
vote
1 answer

Testing inline callback function with JsTestDriver and Mockjax

I want to test the following AJAX function my.var = true; my.method = function() { $.getJSON('/path/to/', function(data){ my.var = false; }); } How should I use JsTestDriver to test that my.var has changed?…
jerkan
  • 685
  • 2
  • 10
  • 28
1
vote
3 answers

Trying to run JsTestDriver in Visual Studio 2010, getting an error

I was following some online guides to setting up JSTestDriver in Visual Studio, I can get the server to launch, but the test cannot find the server which is very odd. Here is the error message: java.lang.RuntimeException: Oh Snap! No server…
Tom Stickel
  • 19,633
  • 6
  • 111
  • 113
1
vote
2 answers

JsTestDriver - $ is not a function

I'm getting a strange problem, claiming that $ is not a function/is undefined. Obviously, this means that it thinks JQuery isn't defined, but if I view the source of the page and check requests, JQuery is definitely being pulled. Total 0 tests…
user719958
1 2 3
8 9