1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | QUnit.config.reorder = false;
|
14 |
|
15 | QUnit.config.autorun = false;
|
16 |
|
17 |
|
18 | function sendMessage() {
|
19 | var args = [].slice.call(arguments);
|
20 | alert(JSON.stringify(args));
|
21 | }
|
22 |
|
23 | QUnit.log = function(obj) {
|
24 |
|
25 | if (obj.message === '[object Object], undefined:undefined') { return; }
|
26 |
|
27 | var actual = QUnit.jsDump.parse(obj.actual);
|
28 | var expected = QUnit.jsDump.parse(obj.expected);
|
29 |
|
30 | sendMessage('log', obj.result, actual, expected, obj.message, obj.source);
|
31 | };
|
32 |
|
33 | QUnit.testStart = function(obj) {
|
34 | sendMessage('testStart', obj.name);
|
35 | };
|
36 |
|
37 | QUnit.testDone = function(obj) {
|
38 | sendMessage('testDone', obj.name, obj.failed, obj.passed, obj.total);
|
39 | };
|
40 |
|
41 | QUnit.moduleStart = function(obj) {
|
42 | sendMessage('moduleStart', obj.name);
|
43 | };
|
44 |
|
45 | QUnit.moduleDone = function(obj) {
|
46 | sendMessage('moduleDone', obj.name, obj.failed, obj.passed, obj.total);
|
47 | };
|
48 |
|
49 | QUnit.begin = function() {
|
50 | sendMessage('begin');
|
51 | };
|
52 |
|
53 | QUnit.done = function(obj) {
|
54 | sendMessage('done', obj.failed, obj.passed, obj.total, obj.runtime);
|
55 | };
|