|
20 | 20 | return dupe; |
21 | 21 | } |
22 | 22 | function log(str) { |
23 | | - //__log(str); |
24 | | - |
| 23 | + // Use console.log so our test checker can detect the output |
| 24 | + console.log(str); |
| 25 | + |
| 26 | + // Also keep the Android log for debugging |
25 | 27 | android.util.Log.d("{N} Runtime Tests", str); |
26 | | -// var con = global.console || console; |
27 | | -// if (con && con.log && str) { |
28 | | -// con.log(str); |
29 | | -// } |
30 | 28 | } |
31 | 29 |
|
32 | 30 |
|
|
134 | 132 | } else if (self.verbosity > 2) { |
135 | 133 | resultText = ' ' + (failed ? 'Failed' : skipped ? 'Skipped' : 'Passed'); |
136 | 134 | } |
137 | | - log(inColor(resultText, color)); |
| 135 | + |
| 136 | + // Only log the single character result for non-failures to reduce noise |
| 137 | + if (!failed) { |
| 138 | + log(inColor(resultText, color)); |
| 139 | + } |
138 | 140 |
|
139 | 141 | if (failed) { |
140 | | - if (self.verbosity === 1) { |
141 | | - log(spec.fullName); |
142 | | - } else if (self.verbosity === 2) { |
143 | | - log(' '); |
144 | | - log(indentWithLevel(spec._depth, spec.fullName)); |
| 142 | + // Force a simple debug message first - this should definitely appear |
| 143 | + console.log('FAILURE DETECTED: Starting failure logging'); |
| 144 | + |
| 145 | + // Always log detailed failure information regardless of verbosity |
| 146 | + log(''); |
| 147 | + log('F'); // Show the failure marker |
| 148 | + log(inColor('FAILED TEST: ' + spec.fullName, 'red+bold')); |
| 149 | + log(inColor('Suite: ' + (spec._suite ? spec._suite.description : 'Unknown'), 'red')); |
| 150 | + |
| 151 | + // Also force output directly to console.log to ensure it's captured |
| 152 | + console.log('JASMINE FAILURE: ' + spec.fullName); |
| 153 | + console.log('JASMINE SUITE: ' + (spec._suite ? spec._suite.description : 'Unknown')); |
| 154 | + |
| 155 | + // Try to extract file information from the stack trace |
| 156 | + var fileInfo = 'Unknown file'; |
| 157 | + if (spec.failedExpectations && spec.failedExpectations.length > 0 && spec.failedExpectations[0].stack) { |
| 158 | + var stackLines = spec.failedExpectations[0].stack.split('\n'); |
| 159 | + for (var j = 0; j < stackLines.length; j++) { |
| 160 | + if (stackLines[j].includes('.js:') && stackLines[j].includes('app/')) { |
| 161 | + var match = stackLines[j].match(/app\/([^:]+\.js)/); |
| 162 | + if (match) { |
| 163 | + fileInfo = match[1]; |
| 164 | + break; |
| 165 | + } |
| 166 | + } |
| 167 | + } |
145 | 168 | } |
146 | | - |
| 169 | + log(inColor('File: ' + fileInfo, 'red')); |
| 170 | + console.log('JASMINE FILE: ' + fileInfo); |
| 171 | + |
147 | 172 | for (var i = 0, failure; i < spec.failedExpectations.length; i++) { |
148 | | - log(inColor(indentWithLevel(spec._depth, indent_string + spec.failedExpectations[i].message), color)); |
| 173 | + log(inColor(' Error: ' + spec.failedExpectations[i].message, color)); |
| 174 | + console.log('JASMINE ERROR: ' + spec.failedExpectations[i].message); |
| 175 | + |
| 176 | + if (spec.failedExpectations[i].stack) { |
| 177 | + // Only show first few lines of stack trace to avoid clutter |
| 178 | + var stackLines = spec.failedExpectations[i].stack.split('\n').slice(0, 3); |
| 179 | + stackLines.forEach(function(line) { |
| 180 | + if (line.trim()) { |
| 181 | + log(inColor(' ' + line.trim(), 'yellow')); |
| 182 | + console.log('JASMINE STACK: ' + line.trim()); |
| 183 | + } |
| 184 | + }); |
| 185 | + } |
149 | 186 | } |
| 187 | + log(''); |
150 | 188 | } |
151 | 189 | }; |
152 | 190 | self.suiteDone = function(suite) { |
|
0 commit comments