From 103b24854edc065d0fa8c21c9a6d6023425d0237 Mon Sep 17 00:00:00 2001 From: Rohit Paul <113459757+RohitPaul0007@users.noreply.github.com> Date: Sat, 9 Sep 2023 18:59:49 +0530 Subject: [PATCH] Update barycenter-test.js --- test/order/barycenter-test.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/order/barycenter-test.js b/test/order/barycenter-test.js index 53a8fa59..2a949926 100644 --- a/test/order/barycenter-test.js +++ b/test/order/barycenter-test.js @@ -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() @@ -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" }); }); @@ -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 }); }); @@ -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 }); }); @@ -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 }); }); @@ -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" });