MCPcopy Index your code
hub / github.com/totaljs/framework / NEXT

Function NEXT

test.js:54–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52});
53
54function NEXT() {
55
56 T.immediate && clearImmediate(T.immediate);
57 T.immediate = null;
58
59 var fn = T.current ? T.current.items.shift() : null;
60
61 if (fn != null) {
62 fn();
63 return;
64 }
65
66 if (T.current) {
67 T.results.push(T.current);
68 console.log('');
69 }
70
71 var test = F.tests.tests.shift();
72 if (test == null) {
73
74 console.log('===================== RESULTS ======================');
75 console.log('');
76 console.log('> Passed .........', T.countok + '/' + T.count);
77 console.log('> Failed ' + (T.countno ? '[x] .....' : '.........'), T.countno + '/' + T.count);
78 console.log('');
79
80 F.isTest = false;
81 F.emit('test-end', T);
82
83 // DONE
84 setTimeout(function() {
85 F.kill(T.countno ? 1 : 0);
86 }, 1000);
87
88 } else {
89
90 T.current = test;
91 T.current.results = [];
92
93 console.log('[ TEST: ' + test.filename.substring(F.path.tests().length) + (T.current.priority ? ' ({0}) ]'.format(T.current.priority) : ' ]'));
94 console.log('');
95
96 NEXT();
97 }
98}
99
100global.TEST = function(name, url, scope) {
101

Callers 1

test.jsFile · 0.85

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected