Skip to content

Commit

Permalink
Merge pull request #371 from RohitPaul0007/patch-13
Browse files Browse the repository at this point in the history
Update barycenter-test.js
  • Loading branch information
rustedgrail authored Sep 11, 2023
2 parents 438848c + 103b248 commit c69b9c0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/order/barycenter-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var expect = require("../chai").expect;
var barycenter = require("../../lib/order/barycenter");
var Graph = require("@dagrejs/graphlib").Graph;
let expect = require("../chai").expect;
let barycenter = require("../../lib/order/barycenter");
let Graph = require("@dagrejs/graphlib").Graph;

describe("order/barycenter", () => {
var g;
let g;

beforeEach(() => {
g = new Graph()
Expand All @@ -14,7 +14,7 @@ describe("order/barycenter", () => {
it("assigns an undefined barycenter for a node with no predecessors", () => {
g.setNode("x", {});

var results = barycenter(g, ["x"]);
let results = barycenter(g, ["x"]);
expect(results).to.have.length(1);
expect(results[0]).to.eql({ v: "x" });
});
Expand All @@ -23,7 +23,7 @@ describe("order/barycenter", () => {
g.setNode("a", { order: 2 });
g.setEdge("a", "x");

var results = barycenter(g, ["x"]);
let results = barycenter(g, ["x"]);
expect(results).to.have.length(1);
expect(results[0]).eqls({ v: "x", barycenter: 2, weight: 1 });
});
Expand All @@ -34,7 +34,7 @@ describe("order/barycenter", () => {
g.setEdge("a", "x");
g.setEdge("b", "x");

var results = barycenter(g, ["x"]);
let results = barycenter(g, ["x"]);
expect(results).to.have.length(1);
expect(results[0]).eqls({ v: "x", barycenter: 3, weight: 2 });
});
Expand All @@ -45,7 +45,7 @@ describe("order/barycenter", () => {
g.setEdge("a", "x", { weight: 3 });
g.setEdge("b", "x");

var results = barycenter(g, ["x"]);
let results = barycenter(g, ["x"]);
expect(results).to.have.length(1);
expect(results[0]).eqls({ v: "x", barycenter: 2.5, weight: 4 });
});
Expand All @@ -60,7 +60,7 @@ describe("order/barycenter", () => {
g.setEdge("a", "z", { weight: 2 });
g.setEdge("c", "z");

var results = barycenter(g, ["x", "y", "z"]);
let results = barycenter(g, ["x", "y", "z"]);
expect(results).to.have.length(3);
expect(results[0]).eqls({ v: "x", barycenter: 1.5, weight: 2 });
expect(results[1]).eqls({ v: "y" });
Expand Down

0 comments on commit c69b9c0

Please sign in to comment.