Questions tagged [jsunit]

JsUnit is an open source Unit Testing framework for client-side (in-browser) JavaScript

JsUnit is an open source Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript. Also included is a platform for automating the execution of tests on multiple browsers and multiple machines running different OSs.

JsUnit GitHub page

26 questions
7
votes
1 answer

avoid / capture / verify a Javascript alert when testing a method that displays one with qunit

I'm just starting using Qunit and would like to know whether is there a way to capture/verify/omit alerts, For example: function to_test() { alert("I'm displaying an alert"); return 42; } and then have something like: test("to_test",…
Soledad
  • 85
  • 2
  • 6
5
votes
2 answers

Must JsUnit Cases Reside Under the Same Directory as JsUnit?

I have installed JsUnit and a test case as…
chernevik
  • 3,750
  • 9
  • 38
  • 53
4
votes
1 answer

How to specify a relative path for the jsUnit-ant-script?

JsUnit provides an ant-script with the target 'standalone_test'. This target uses the property url to identify the HTML-site, that executes the tests. These site is checked in, so that everyone should be able after a checkout to execute this tests.…
Mnementh
  • 47,129
  • 42
  • 140
  • 198
3
votes
1 answer

How to test ajax with jsunit?

Did anybody write tests for ajax with jsunit? I don't now how to test asynchronous functions. Could you please show me some examples? Example. I have function var General = function() { } General.prototype = { limit: null, loadData: function() { …
isxaker
  • 6,265
  • 6
  • 48
  • 77
3
votes
2 answers

Wrapping JsUnit in JUnit

I'm required to use JSUnit in my Spring-MVC project. It seems that I could write some test pages, include some of my js files, write some tests, and load up my pages with the testRunner. Fine. But the jsunit download comes with a jsunit.jar, which…
Samo
  • 7,964
  • 9
  • 53
  • 91
3
votes
1 answer

Unit test a firefox extension?

I'm working on a Firefox extension and started building automated tests using jsUnit. I run into permission errors running the tests from the TestRunner as soon as my extension code refers to any XPCom components. Is there a better tool for me to…
Wheeyls
  • 1,012
  • 1
  • 7
  • 14
2
votes
0 answers

JsUnit ant build not finding jsunit/acceptor

I'm trying to create a distributed test using JsUnit. When I run my ant build (after having set the properties as I think they should be), the testrunner runs my test on my local machine. The tests are green, but it is unable to submit the results…
chama
  • 5,537
  • 13
  • 57
  • 72
2
votes
1 answer

jsUnit and build.xml

So I want a build.xml file that I can invoke from Hudson to run my jsUnit tests. However, the build.xml file has a few things that it needs to ... I guess run the unit tests. One of things it needs are these browser files such as ie.exe or…
shenama
  • 21
  • 1
1
vote
1 answer

Google Closure Javascript testing, disable autodiscover tests

Currently i am implementing the Google closure testing possibilities. It works as a charm. I Define the TestCase by hand, and add the test by hand. I also create a separate runner for the tests so I can catch all the results and pass them to another…
Bloeper
  • 339
  • 2
  • 3
  • 13
1
vote
1 answer

Getting JSUnit, Ant & Hudson working

I'm trying to get my JSUnit tests to run on Hudson. But the browser keeps timing out: [junit] INFO: Launching Internet Explorer on…
Christian Payne
  • 6,903
  • 5
  • 35
  • 59
1
vote
1 answer

How to create test suite in JsUnit

How do I create a test suite in JsUnit like I would with JUnit? I have many tests that I would like to run together. For example, I have two tests in test1.html and test2.html that I would like to group together to run.
user9919833
1
vote
1 answer

What does assertEquals() in JSUnit actually do?

I am doing some unit test exercises using a HTML5/JS game I wrote and JSUnit test runner. I am satisfied by the simplicity of it but that simplicity goes even in the docs as there is no explanation what trully assertEquals() does. I made a stub aka…
Vlad
  • 2,591
  • 4
  • 43
  • 88
1
vote
2 answers

JSunit usability

Is JSunit really a direct port of Junit to Javascript? So I have heard, but I am wondering why my company is not using it. My company has lots of smart minds, so If we are not using it I wonder if there are any major issues with Jsunit as a…
stevebot
  • 21,481
  • 26
  • 107
  • 176
1
vote
0 answers

any new firefox 3.5.X security improvements that'd prevent access "chrome://" uri paths in markup?

A little context: I'm trying to build and run the unit tests for the source of the Selenium IDE plugin. Everything builds correctly (through maven commands, et al) and the unit tests fire up an instance of Firefox. However, the jsUnit…
kdawg
  • 1,999
  • 20
  • 29
1
vote
5 answers

Javascript: how to override public method in some class?

I have such JS class that have to be tested: SomeClass = function { // some stuff that uses initRequest this.initRequest = function() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else…
DixonD
  • 6,094
  • 4
  • 28
  • 49
1
2