more tweaks to the pretty print function

This commit is contained in:
Christopher Chedeau
2014-12-11 13:56:29 +00:00
parent 0f9b777623
commit e0bcbdcfc1

View File

@@ -19,8 +19,9 @@ var layoutTestUtils = (function() {
englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });
var pp = function(node) { var pp = function(node) {
return JSON.stringify(node, null, 2) return jasmine.pp(node)
.replace(/"([a-zA-Z]+)":/g, '$1:'); .replace(/([\{\[]) /g, '$1')
.replace(/ ([\}\]:])/g, '$1');
}; };
var message = 'Expected ' + var message = 'Expected ' +
@@ -347,8 +348,8 @@ var layoutTestUtils = (function() {
testNamedLayout('layout-dom', layout, domLayout); testNamedLayout('layout-dom', layout, domLayout);
}, },
testRandomLayout: function(node, i) { testRandomLayout: function(node, i) {
expect({i: i, node: node, layout: computeCSSLayout(node)}) expect({node: node, layout: computeCSSLayout(node)})
.toEqual({i: i, node: node, layout: computeDOMLayout(node)}); .toEqual({node: node, layout: computeDOMLayout(node)});
}, },
testsFinished: function() { testsFinished: function() {
console.log('tests finished!'); console.log('tests finished!');