mirror of
https://github.com/less/less.js.git
synced 2026-02-07 13:35:10 -05:00
use diff in less-test.js to display more info on test failures
This commit is contained in:
committed by
Luke Page
parent
c20cc598c5
commit
44ec3a151c
@@ -30,6 +30,14 @@ fs.readdirSync('test/less').forEach(function (file) {
|
||||
sys.print(stylize("ERROR: " + (err && err.message), 'red'));
|
||||
} else {
|
||||
sys.print(stylize("FAIL", 'yellow'));
|
||||
|
||||
require('diff').diffLines(css, less).forEach(function(item) {
|
||||
if(item.added || item.removed) {
|
||||
sys.print(stylize(item.value, item.added ? 'green' : 'red'));
|
||||
} else {
|
||||
sys.print(item.value);
|
||||
}
|
||||
})
|
||||
}
|
||||
sys.puts("");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user