more unit tests

This commit is contained in:
Clément GOUIN
2019-07-11 16:03:27 +02:00
parent a0f5af5c0e
commit e785b471f4
2 changed files with 60 additions and 4 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ module.exports = (options) => {
/**
* @param {Object<string,Node1>} nodes
*/
debugMap: (nodes) => {
/*debugMap: (nodes) => {
const b = self.getBounds(nodes);
const map = newmap(b.w, b.h).map(row => row.map(() => []));
@@ -38,7 +38,7 @@ module.exports = (options) => {
}));
out = out.map(row => row.map(cell => cell + new Array(maxLen - cell.length).fill(' ').join('')));
console.log('\n' + out.map(row => row.join('|')).join('\n') + '\n');
},
},*/
/**
* Get the current bounds of the graph of nodes
@@ -255,7 +255,7 @@ module.exports = (options) => {
* @returns {null|Object<string,Node1>}
*/
applyLinks: (nodes, links, depth = 0) => {
if (self.debug) self.debugMap(nodes);
//if (self.debug) self.debugMap(nodes);
if (!self.isValid(nodes, links)) {
if (self.debug) console.log(`${new Array(depth).fill('.').join('')}invalid node placement`);