UNPKG

peng-pathfinding

Version:

Comprehensive pathfinding library for grid based games

1,181 lines 62.3 kB
{ "stats": { "suites": 19, "tests": 57, "passes": 57, "pending": 0, "failures": 0, "start": "2018-11-16T03:45:01.201Z", "end": "2018-11-16T03:45:01.251Z", "duration": 50, "testsRegistered": 57, "passPercent": 100, "pendingPercent": 0, "other": 0, "hasOther": false, "skipped": 0, "hasSkipped": false, "passPercentClass": "success", "pendingPercentClass": "danger" }, "suites": { "uuid": "91504e35-0e0e-447f-8764-50c576506b40", "title": "", "fullFile": "", "file": "", "beforeHooks": [], "afterHooks": [], "tests": [], "suites": [ { "uuid": "8f9023c1-02a9-43c4-b86d-1511093ea491", "title": "Grid", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\Grid.js", "file": "\\test\\Grid.js", "beforeHooks": [], "afterHooks": [], "tests": [], "suites": [ { "uuid": "f639bcdb-ac0d-40e5-83c2-4461703a68b9", "title": "generate without matrix", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\Grid.js", "file": "\\test\\Grid.js", "beforeHooks": [ { "title": "\"before each\" hook", "fullTitle": "Grid generate without matrix \"before each\" hook", "timedOut": false, "duration": 0, "pass": false, "fail": false, "pending": false, "code": "width = 10;\nheight = 20;\ngrid = new Grid(width, height);", "err": {}, "isRoot": false, "uuid": "ac8bdd86-5a1a-4eed-9d2c-ab634b9c68ec", "isHook": true, "skipped": false } ], "afterHooks": [], "tests": [ { "title": "should have correct size", "fullTitle": "Grid generate without matrix should have correct size", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "grid.width.should.equal(width);\ngrid.height.should.equal(height);\ngrid.nodes.length.should.equal(height);\nfor (var i = 0; i < height; ++i) {\n grid.nodes[i].length.should.equal(width); \n}", "err": {}, "isRoot": false, "uuid": "fa4f9131-4968-49fc-b554-3d7e4e173e6c", "isHook": false, "skipped": false }, { "title": "should set all nodes' walkable attribute", "fullTitle": "Grid generate without matrix should set all nodes' walkable attribute", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "for (var i = 0; i < height; ++i) {\n for (var j = 0; j < width; ++j) {\n grid.isWalkableAt(j, i).should.be.true;\n }\n}", "err": {}, "isRoot": false, "uuid": "edf940cc-3874-4f4b-bfd5-fcd7e421672b", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "fa4f9131-4968-49fc-b554-3d7e4e173e6c", "edf940cc-3874-4f4b-bfd5-fcd7e421672b" ], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "cb1a939f-71db-41ec-acb1-2c721e88a2c8", "title": "generate with matrix", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\Grid.js", "file": "\\test\\Grid.js", "beforeHooks": [ { "title": "\"before each\" hook", "fullTitle": "Grid generate with matrix \"before each\" hook", "timedOut": false, "duration": 0, "pass": false, "fail": false, "pending": false, "code": "matrix = [\n [1, 0, 0, 1],\n [0, 1, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 0, 0],\n [1, 0, 0, 1],\n];\nheight = matrix.length;\nwidth = matrix[0].length;\ngrid = new Grid(width, height, matrix);", "err": {}, "isRoot": false, "uuid": "51094b8e-cdc3-46d3-9a3b-17e6d70c76e1", "isHook": true, "skipped": false } ], "afterHooks": [], "tests": [ { "title": "should have correct size", "fullTitle": "Grid generate with matrix should have correct size", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "grid.width.should.equal(width);\ngrid.height.should.equal(height);\ngrid.nodes.length.should.equal(height);\nfor (var i = 0; i < height; ++i) {\n grid.nodes[i].length.should.equal(width); \n}", "err": {}, "isRoot": false, "uuid": "f5e87b5b-89f3-4c43-8378-27e0a5619b76", "isHook": false, "skipped": false }, { "title": "should initiate all nodes' walkable attribute", "fullTitle": "Grid generate with matrix should initiate all nodes' walkable attribute", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "enumPos(function(x, y, g) {\n if (matrix[y][x]) {\n g.isWalkableAt(x, y).should.be.false;\n } else {\n g.isWalkableAt(x, y).should.be.true;\n }\n});", "err": {}, "isRoot": false, "uuid": "c551fe42-9e3a-4637-bb4c-73c4936ba514", "isHook": false, "skipped": false }, { "title": "should be able to set nodes' walkable attribute", "fullTitle": "Grid generate with matrix should be able to set nodes' walkable attribute", "timedOut": false, "duration": 1, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "enumPos(function(x, y) {\n grid.setWalkableAt(x, y, false); \n});\nenumPos(function(x, y) {\n grid.isWalkableAt(x, y).should.be.false;\n})\nenumPos(function(x, y) {\n grid.setWalkableAt(x, y, true); \n});\nenumPos(function(x, y) {\n grid.isWalkableAt(x, y).should.be.true;\n})", "err": {}, "isRoot": false, "uuid": "efb37922-ad44-4993-b11d-d5e50ff8f2bc", "isHook": false, "skipped": false }, { "title": "should return correct answer for position validity query", "fullTitle": "Grid generate with matrix should return correct answer for position validity query", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "var asserts = [\n [0, 0, true],\n [0, height - 1, true],\n [width - 1, 0, true],\n [width - 1, height - 1, true],\n [-1, -1, false],\n [0, -1, false],\n [-1, 0, false],\n [0, height, false],\n [width, 0, false],\n [width, height, false],\n];\nasserts.forEach(function(v, i, a) {\n grid.isInside(v[0], v[1]).should.equal(v[2]);\n});", "err": {}, "isRoot": false, "uuid": "16fc74d5-f4d5-4795-8102-822f45453519", "isHook": false, "skipped": false }, { "title": "should return correct neighbors", "fullTitle": "Grid generate with matrix should return correct neighbors", "timedOut": false, "duration": 1, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "grid.getNeighbors(grid.nodes[1][0], DiagonalMovement.Never).should.eql([ grid.nodes[2][0] ]);\nvar cmp = function(a, b) {\n return a.x * 100 + a.y - b.x * 100 - b.y;\n};\ngrid.getNeighbors(grid.nodes[0][2], DiagonalMovement.IfAtMostOneObstacle).sort(cmp).should.eql([\n grid.nodes[0][1], grid.nodes[1][2], grid.nodes[1][3]\n].sort(cmp))", "err": {}, "isRoot": false, "uuid": "d02adc6f-76db-4ae9-a0e7-4e9bc7e3aacb", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "f5e87b5b-89f3-4c43-8378-27e0a5619b76", "c551fe42-9e3a-4637-bb4c-73c4936ba514", "efb37922-ad44-4993-b11d-d5e50ff8f2bc", "16fc74d5-f4d5-4795-8102-822f45453519", "d02adc6f-76db-4ae9-a0e7-4e9bc7e3aacb" ], "failures": [], "pending": [], "skipped": [], "duration": 2, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "a9be21ba-f3c7-4025-bdcc-92c1ce29dbb4", "title": "generate with matrix and no width or height", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\Grid.js", "file": "\\test\\Grid.js", "beforeHooks": [ { "title": "\"before each\" hook", "fullTitle": "Grid generate with matrix and no width or height \"before each\" hook", "timedOut": false, "duration": 0, "pass": false, "fail": false, "pending": false, "code": "matrix = [\n [1, 0, 0, 1],\n [0, 1, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 0, 0],\n [1, 0, 0, 1],\n];\ngrid = new Grid(matrix);", "err": {}, "isRoot": false, "uuid": "640c6f72-7f68-4f17-b99a-a922abacc8e8", "isHook": true, "skipped": false } ], "afterHooks": [], "tests": [ { "title": "should have correct size", "fullTitle": "Grid generate with matrix and no width or height should have correct size", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "var height = matrix.length;\nvar width = matrix[0].length;\ngrid.width.should.equal(width);\ngrid.height.should.equal(height);\ngrid.nodes.length.should.equal(height);\nfor (var i = 0; i < height; ++i) {\n grid.nodes[i].length.should.equal(width);\n}", "err": {}, "isRoot": false, "uuid": "2eedbc49-708e-44c8-b1fc-afcfb7a9e0b8", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "2eedbc49-708e-44c8-b1fc-afcfb7a9e0b8" ], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": false, "rootEmpty": false, "_timeout": 2000 } ], "passes": [], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "7eaf9bde-75e0-4dca-933c-937a2292aea6", "title": "AStar", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "AStar should solve maze 1", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "29c2a46b-4cab-4a07-856b-93a017cd0f84", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "AStar should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "b3a08bbb-0efd-4b50-9dba-c39187789621", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "AStar should solve maze 3", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "331eb905-ed38-4768-93d4-c3b2174a15f2", "isHook": false, "skipped": false }, { "title": "should solve maze 4", "fullTitle": "AStar should solve maze 4", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "984929d8-02ba-4db0-81a3-e6c46eef0d81", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "29c2a46b-4cab-4a07-856b-93a017cd0f84", "b3a08bbb-0efd-4b50-9dba-c39187789621", "331eb905-ed38-4768-93d4-c3b2174a15f2", "984929d8-02ba-4db0-81a3-e6c46eef0d81" ], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "7682f499-03c3-4530-bcbc-afa04ac27ecb", "title": "BreadthFirst", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "BreadthFirst should solve maze 1", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "22baf471-4f08-4cb9-aa6c-d6ae480d9fb5", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "BreadthFirst should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "4fb1edd8-7199-4cac-a75f-6c6231ab3f4d", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "BreadthFirst should solve maze 3", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "7153ee36-bab4-427d-b9f8-6c7af273eccd", "isHook": false, "skipped": false }, { "title": "should solve maze 4", "fullTitle": "BreadthFirst should solve maze 4", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "e1796b0f-57c0-431a-8a72-a7e9f80e8932", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "22baf471-4f08-4cb9-aa6c-d6ae480d9fb5", "4fb1edd8-7199-4cac-a75f-6c6231ab3f4d", "7153ee36-bab4-427d-b9f8-6c7af273eccd", "e1796b0f-57c0-431a-8a72-a7e9f80e8932" ], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "73a23ecb-57c2-4e56-85c2-7d6793a29956", "title": "Dijkstra", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "Dijkstra should solve maze 1", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "27d3799f-dc43-45e6-a0fc-2bdc32bb44da", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "Dijkstra should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "00af45b4-3034-4e07-9605-7ff70f24cc5b", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "Dijkstra should solve maze 3", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "a0ffa901-8f42-4443-952a-beb4f4b312ab", "isHook": false, "skipped": false }, { "title": "should solve maze 4", "fullTitle": "Dijkstra should solve maze 4", "timedOut": false, "duration": 1, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "447259c4-a074-448e-842f-97916e06017e", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "27d3799f-dc43-45e6-a0fc-2bdc32bb44da", "00af45b4-3034-4e07-9605-7ff70f24cc5b", "a0ffa901-8f42-4443-952a-beb4f4b312ab", "447259c4-a074-448e-842f-97916e06017e" ], "failures": [], "pending": [], "skipped": [], "duration": 1, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "4ee4aa52-c4ca-4710-b3df-76c34a7bfabb", "title": "BiBreadthFirst", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "BiBreadthFirst should solve maze 1", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "cf92e4e3-dee0-47b0-8574-1dc05db25583", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "BiBreadthFirst should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "de2ec2e4-e30e-4131-b8dc-e6cdc8cdb050", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "BiBreadthFirst should solve maze 3", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "fb7ecfe8-46fb-461e-b838-442ebbb059f4", "isHook": false, "skipped": false }, { "title": "should solve maze 4", "fullTitle": "BiBreadthFirst should solve maze 4", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "107b4387-9d11-484d-9725-51ad7936702e", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "cf92e4e3-dee0-47b0-8574-1dc05db25583", "de2ec2e4-e30e-4131-b8dc-e6cdc8cdb050", "fb7ecfe8-46fb-461e-b838-442ebbb059f4", "107b4387-9d11-484d-9725-51ad7936702e" ], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "29cdd41d-0e7f-402f-af40-67eb3799785c", "title": "BiDijkstra", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "BiDijkstra should solve maze 1", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "a66f2ed4-af7c-49f2-a9e5-68707be1365a", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "BiDijkstra should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "6ba45b8c-eb6f-4c88-bdbc-60d8963446cd", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "BiDijkstra should solve maze 3", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "d3d39ffd-b1bb-4597-8d2a-88b38b62b87e", "isHook": false, "skipped": false }, { "title": "should solve maze 4", "fullTitle": "BiDijkstra should solve maze 4", "timedOut": false, "duration": 1, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "6a3a0d96-da44-49a3-80d0-e0a70e80f9b2", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "a66f2ed4-af7c-49f2-a9e5-68707be1365a", "6ba45b8c-eb6f-4c88-bdbc-60d8963446cd", "d3d39ffd-b1bb-4597-8d2a-88b38b62b87e", "6a3a0d96-da44-49a3-80d0-e0a70e80f9b2" ], "failures": [], "pending": [], "skipped": [], "duration": 1, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "d4a7508a-5e60-419c-91b1-dff11173f24b", "title": "BiAStar", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "BiAStar should solve maze 1", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "faa5f31c-2d10-44e3-bb9f-7a8b6eed805c", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "BiAStar should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "ca6c91f2-473e-462e-9b18-4fd14f2793aa", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "BiAStar should solve maze 3", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "f3fc494c-7da6-43b5-9e05-6cb8a9a02407", "isHook": false, "skipped": false }, { "title": "should solve maze 4", "fullTitle": "BiAStar should solve maze 4", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "cbae4265-9669-4835-8e24-57194f8694f2", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "faa5f31c-2d10-44e3-bb9f-7a8b6eed805c", "ca6c91f2-473e-462e-9b18-4fd14f2793aa", "f3fc494c-7da6-43b5-9e05-6cb8a9a02407", "cbae4265-9669-4835-8e24-57194f8694f2" ], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "eda27dcd-af58-4ac5-8281-e31aaa2c35ea", "title": "BestFirst", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "BestFirst should solve maze 1", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "4bdb889f-e63c-4b45-a460-3d6fe2b80dce", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "BestFirst should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "9848069c-8d3b-4494-8d93-452625d49142", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "BestFirst should solve maze 3", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "6d22a800-2dbf-40fb-aa2f-a4abccfe161c", "isHook": false, "skipped": false }, { "title": "should solve maze 4", "fullTitle": "BestFirst should solve maze 4", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "23564bd0-c55e-4ae9-bbc9-33cdb4728e81", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "4bdb889f-e63c-4b45-a460-3d6fe2b80dce", "9848069c-8d3b-4494-8d93-452625d49142", "6d22a800-2dbf-40fb-aa2f-a4abccfe161c", "23564bd0-c55e-4ae9-bbc9-33cdb4728e81" ], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "60d04cea-c2af-4460-b9e5-380c73dafe6c", "title": "BiBestFirst", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "BiBestFirst should solve maze 1", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "1326359f-bc02-417a-b7e3-51e06ad25dd1", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "BiBestFirst should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "4b054d06-f701-4ec8-b8df-28ec810e34d3", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "BiBestFirst should solve maze 3", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "664c8b7c-f636-4580-a80d-d0354bcdab8b", "isHook": false, "skipped": false }, { "title": "should solve maze 4", "fullTitle": "BiBestFirst should solve maze 4", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "287c2b03-c390-4859-9800-a4c3a1a01185", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "1326359f-bc02-417a-b7e3-51e06ad25dd1", "4b054d06-f701-4ec8-b8df-28ec810e34d3", "664c8b7c-f636-4580-a80d-d0354bcdab8b", "287c2b03-c390-4859-9800-a4c3a1a01185" ], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "2d1d6a12-172e-4681-961b-75c90e0b6264", "title": "IDAStar", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "IDAStar should solve maze 1", "timedOut": false, "duration": 1, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "e67ffdd8-7e84-43dd-9ed9-a4fbaee50bac", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "IDAStar should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "4343f59d-e572-42fb-b943-4a6751a2f2a4", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "IDAStar should solve maze 3", "timedOut": false, "duration": 1, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "29d2dc2d-f472-474c-81e9-c949df1eee56", "isHook": false, "skipped": false }, { "title": "should solve maze 4", "fullTitle": "IDAStar should solve maze 4", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "ff2c6987-bcd6-40ea-898a-dd6cd45c495d", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "e67ffdd8-7e84-43dd-9ed9-a4fbaee50bac", "4343f59d-e572-42fb-b943-4a6751a2f2a4", "29d2dc2d-f472-474c-81e9-c949df1eee56", "ff2c6987-bcd6-40ea-898a-dd6cd45c495d" ], "failures": [], "pending": [], "skipped": [], "duration": 2, "root": false, "rootEmpty": false, "_timeout": 2000 }, { "uuid": "a06a9faa-4b6e-4060-8618-f150164593c5", "title": "JPFMoveDiagonallyIfAtMostOneObstacle", "fullFile": "C:\\Users\\Administrator\\Desktop\\PathFinding.js-master\\test\\PathTest.js", "file": "\\test\\PathTest.js", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "should solve maze 1", "fullTitle": "JPFMoveDiagonallyIfAtMostOneObstacle should solve maze 1", "timedOut": false, "duration": 1, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "bbedd7e3-e52c-4ad0-b813-1b5bba9ad156", "isHook": false, "skipped": false }, { "title": "should solve maze 2", "fullTitle": "JPFMoveDiagonallyIfAtMostOneObstacle should solve maze 2", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([startX, startY]);\n path[path.length - 1].should.eql([endX, endY]);\n}", "err": {}, "isRoot": false, "uuid": "6f0e93fb-7a60-4819-8a94-1f4e520fb650", "isHook": false, "skipped": false }, { "title": "should solve maze 3", "fullTitle": "JPFMoveDiagonallyIfAtMostOneObstacle should solve maze 3", "timedOut": false, "duration": 0, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "path = finder.findPath(startX, startY, endX, endY, grid);\nif (optimal) {\n path.length.should.equal(expectedLength);\n} else {\n path[0].should.eql([star