js-test-driver

Event listeners & js-test-driver?

杀马特。学长 韩版系。学妹 提交于 2019-12-25 08:29:03
问题 My JS gets loaded after the DOM is ready. Once the DOM is ready, the JS checks certain aspects of the environment (window dimensions etc.), binds event listeners to specific elements and then, finally, runs. How do I set this up in js-test-driver? I can use /*:DOC += ... */ to mock my HTML, but I'm not sure how to do that first, then load my script, and have it bind event listeners to elements in it. Honestly, what I'd rather have is jstestdriver load my html page along with all the listed

JsTestDriver - $ is not a function

半腔热情 提交于 2019-12-24 12:15:49
问题 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 (Passed: 0; Fails: 0; Errors: 0) (0.00 ms) Firefox 8.0 Linux: Run 10 tests (Passed: 0; Fails: 0; Errors 10) (0.00 ms) error loading file: /test/src/coffee.js:88: $ is not a function My config file is as follows; server: http://localhost:9876 timeout: 90

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

♀尐吖头ヾ 提交于 2019-12-23 19:06:53
问题 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 understand how to install a plugin from an Archive. But what is the trick to installing a plugin that you've compiled from source? I've tried adding the directory: C:\temp\test_workspace\js-test-driver-plugin\1.2\eclipse-plugin\features\com.google

How to fix issue of code coverage not finding functions when run tests do?

我是研究僧i 提交于 2019-12-13 02:56:53
问题 When running my tests they all pass. When running code coverage 4 fail due to functions being 'not defined'. They are defined (as the tests clearly show when they pass). I cannot get the code coverage for the file that has the 4 functions being tested in those tests which is not good as I need to know if the functions are fully tested. I am on PHPStorm. The jsTestDriver for these tests has a file made by me, Sinon v7.3.2, jQuery v1.11.1, and D3.js v5.9.7 as dependencies. load: - buttonActions

ReferenceError: CoffeeScript + JsTestDriver + Qunit

谁说胖子不能爱 提交于 2019-12-11 13:22:59
问题 Currently I'm looking into TDD with CoffeeScript and JsTestDriver however I'm stuck on a ReferenceError thrown by JsTestDriver. Some info: Using the IntelliJ JsTestDriver plugin Testing via Chrome Configured JsTestDriver the same way as on: http://code.google.com/p/js-test-driver/wiki/QUnitAdapter Writing the tests in CoffeeScript CoffeeScript is compiled to javascript and put in the configured directories before the test is run Config server: http://Mark-PC:9876/capture load: - js/lib/main/*

Is it possible to run js-test-driver tests that uses requirejs modules?

人盡茶涼 提交于 2019-12-11 08:34:25
问题 I've been trying to use requirejs and js-test-driver along side, and I can't seen to get it working. I have a minimal configuration like this at the root : server: http://localhost:9876 load: - src/main/resources/web/resources/vendor/requirejs/require.js test: - src/test/js/*.js A "src/main/js/greeter.js" file defines a silly module : define(function(require) { myapp = {}; myapp.Greeter = function() { }; myapp.Greeter.prototype.greet = function(name) { return "Hello " + name + "!"; }; return

Compiling JS-Test-Driver Plugin and Installing it on Eclipse 3.5.1 Galileo?

纵饮孤独 提交于 2019-12-11 02:14:10
问题 I downloaded the source of the js-test-driver from: http://js-test-driver.googlecode.com/svn/tags/1.2 It compiles just fine, but one of the unit tests fails: [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.012 sec [junit] Test com.google.jstestdriver.eclipse.ui.views.FailureOnlyViewerFilterTest FAILED I am using: - ANT 1.7.1 - javac 1.6.0_12 And I'm trying to install the js-test-driver plugin on Eclipse 3.5.1 Galileo Despite the failed test I installed the plugin into my C:

Require.JS and JS Test Driver: Unexpected token <

你离开我真会死。 提交于 2019-12-10 10:35:37
问题 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: (attrs) -> errs = {} hasErrors = false if (attrs.title is "") hasErrors = true errs.title = "Please specify a todo" if hasErrors return errs toggleDone: -> @save("done", !@get("done")) return Todo My tests look like: requirejs.config baseUrl: "js/" paths: jquery: "https://ajax.googleapis.com/ajax/libs/jquery

Run Headless JsTestDriver?

亡梦爱人 提交于 2019-12-07 11:05:30
问题 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? 回答1: There is no way to configure JsTestDriver to open the browser minimized. And you have to open the browsers because they run the JavaScript code. You can try to create a virtual monitor and open the browser there. Under linux you can use xvfb for this, for example xvfb-run java -jar JsTestDriver-1.3.3d.jar --tests all --port 4224

Require.JS and JS Test Driver: Unexpected token <

大兔子大兔子 提交于 2019-12-06 09:44:41
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: (attrs) -> errs = {} hasErrors = false if (attrs.title is "") hasErrors = true errs.title = "Please specify a todo" if hasErrors return errs toggleDone: -> @save("done", !@get("done")) return Todo My tests look like: requirejs.config baseUrl: "js/" paths: jquery: "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min" jqueryui: "https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min" json2: "http: