(diff)
| 2224 | } |
| 2225 | |
| 2226 | function colorDiffText(diff) { |
| 2227 | var objects = map(diff, function(part) { |
| 2228 | var text = part.value; |
| 2229 | if (part.added) { |
| 2230 | text = color.green(text); |
| 2231 | } else if (part.removed) { |
| 2232 | text = color.red(text); |
| 2233 | } |
| 2234 | if (diff.length === 2) { |
| 2235 | text += " "; // format simple diffs |
| 2236 | } |
| 2237 | return text; |
| 2238 | }); |
| 2239 | return join(objects, ""); |
| 2240 | } |
| 2241 | |
| 2242 | module.exports = { |
| 2243 | c: function(spyInstance) { |