Debian Codegraph @

test/geo_test.js

raw symbols SCIP
1 (function($) {
2 /*
3 ======== A Handy Little QUnit Reference ========
4 http://api.qunitjs.com/
5
6 Test methods:
7 module(name, {[setup][ ,teardown]})
8 test(name, callback)
9 expect(numberOfAssertions)
10 stop(increment)
11 start(decrement)
12 Test assertions:
13 ok(value, [message])
14 equal(actual, expected, [message])
15 notEqual(actual, expected, [message])
16 deepEqual(actual, expected, [message])
17 notDeepEqual(actual, expected, [message])
18 strictEqual(actual, expected, [message])
19 notStrictEqual(actual, expected, [message])
20 throws(block, [expected], [message])
21 */
22
23 module('jQuery#awesome', {
24 // This will run before each test in this module.
25 setup: function() {
26 this.elems = $('#qunit-fixture').children();
27 }
28 });
29
30 test('is chainable', function() {
31 expect(1);
32 // Not a bad test to run on collection methods.
33 strictEqual(this.elems.awesome(), this.elems, 'should be chainable');
34 });
35
36 test('is awesome', function() {
37 expect(1);
38 strictEqual(this.elems.awesome().text(), 'awesome0awesome1awesome2', 'should be awesome');
39 });
40
41 module('jQuery.awesome');
42
43 test('is awesome', function() {
44 expect(2);
45 strictEqual($.awesome(), 'awesome.', 'should be awesome');
46 strictEqual($.awesome({punctuation: '!'}), 'awesome!', 'should be thoroughly awesome');
47 });
48
49 module(':awesome selector', {
50 // This will run before each test in this module.
51 setup: function() {
52 this.elems = $('#qunit-fixture').children();
53 }
54 });
55
56 test('is awesome', function() {
57 expect(1);
58 // Use deepEqual & .get() when comparing jQuery objects.
59 deepEqual(this.elems.filter(':awesome').get(), this.elems.last().get(), 'knows awesome when it sees it');
60 });
61
62 }(jQuery));