Skip to content

Commit

Permalink
Fixing that 0 tests ran in the CI logs.
Browse files Browse the repository at this point in the history
So apparently, using QUnitAdapter still requires some "porting" from plain QUnit
code. Or maybe QUnitAdapter is way outdated?
  • Loading branch information
skytreader committed Jun 29, 2015
1 parent 2ec7cac commit 1cbcb61
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions jsTestDriver.conf
@@ -1,7 +1,11 @@
server: http://localhost:16981 server: http://localhost:16981


load: load:
- librarian/static/scripts/jquery.js
- librarian/static/scripts/qunit-1.17.1.js
- librarian/static/scripts/equiv.js - librarian/static/scripts/equiv.js
- librarian/static/scripts/QUnitAdapter.js - librarian/static/scripts/QUnitAdapter.js
- librarian/static/scripts/utils/isbn-verify.js
- librarian/static/scripts/tests/isbn-verify.js - librarian/static/scripts/tests/isbn-verify.js
- librarian/static/scripts/utils/visual-queue.js
- librarian/static/scripts/tests/visual-queue.js - librarian/static/scripts/tests/visual-queue.js
22 changes: 11 additions & 11 deletions librarian/static/scripts/tests/isbn-verify.js
@@ -1,16 +1,16 @@
QUnit.test("stripExtraneousTest", function(assert){ test("stripExtraneousTest", function(assert){
assert.equal(stripExtraneous("3.1 4 1 5 92-653"), "3141592653"); equals(stripExtraneous("3.1 4 1 5 92-653"), "3141592653", "test");
}); });


QUnit.test("isbn13Test", function(assert){ test("isbn13Test", function(assert){
assert.ok(verifyISBN13("9780981467306"), "Positive test"); ok(verifyISBN13("9780981467306"), "Positive test");
assert.ok(!verifyISBN13("0156453800"), "Negative test, wrong length"); ok(!verifyISBN13("0156453800"), "Negative test, wrong length");
assert.ok(!verifyISBN13("3141592653589"), "Negative test, ok length"); ok(!verifyISBN13("3141592653589"), "Negative test, ok length");
}); });


QUnit.test("isbn10Test", function(assert){ test("isbn10Test", function(assert){
assert.ok(verifyISBN10("0156453800")); ok(verifyISBN10("0156453800"));
assert.ok(verifyISBN10("1553650808")); ok(verifyISBN10("1553650808"));
assert.ok(!verifyISBN10("9780981467306"), "Negative test, wrong length"); ok(!verifyISBN10("9780981467306"), "Negative test, wrong length");
assert.ok(!verifyISBN10("3141592653"), "Negative test, ok length"); ok(!verifyISBN10("3141592653"), "Negative test, ok length");
}); });
10 changes: 5 additions & 5 deletions librarian/static/scripts/tests/visual-queue.js
@@ -1,14 +1,14 @@
QUnit.module("Q Tests", { module("Q Tests", {
"beforeEach":function(){ "setup":function(){
var qContainer = document.createElement("div"); var qContainer = document.createElement("div");
this.q = new VisualQueue(qContainer, null); this.q = new VisualQueue(qContainer, null);
} }
}); });
QUnit.test("simple count test", function(assert){ test("simple count test", function(assert){
var item1 = document.createElement("div"); var item1 = document.createElement("div");
item1.id = "item1"; item1.id = "item1";
this.q.enqueue(item1); this.q.enqueue(item1);
assert.equal(this.q.queueCounter, 1); equals(this.q.queueCounter, 1, "one item");
this.q.remove(item1.id); this.q.remove(item1.id);
assert.equal(this.q.queueCounter, 0); equals(this.q.queueCounter, 0, "no more items");
}); });

0 comments on commit 1cbcb61

Please sign in to comment.