From 718e94b6e179736aaae0989c6c4dfd0d30f8d9b3 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 22 Jan 2023 10:21:15 +0100 Subject: [PATCH 1/8] remove useless 'document' variable in tests --- test/addImage-test.js | 2 +- test/attributer-test.js | 2 +- test/data-test.js | 2 +- test/destroy-shared-worker-test.js | 2 +- test/destroy-test.js | 2 +- test/destroy-worker-test.js | 4 ++-- test/dot-data-test.js | 2 +- test/dot-empty-node-id-test.js | 2 +- test/dot-no-worker-test.js | 2 +- test/dot-shared-worker-test.js | 2 +- test/dot-viewport-test.js | 10 ++++---- test/dot-worker-test.js | 2 +- ...worker-through-text-javascript-tag-test.js | 2 +- test/drawEdge-style-invis-test.js | 10 ++++---- test/drawEdge-test.js | 22 ++++++++--------- test/drawNode-shape-box-test.js | 2 +- test/drawNode-shape-circle-test.js | 2 +- test/drawNode-shape-cylinder-test.js | 2 +- test/drawNode-shape-default-test.js | 8 +++---- test/drawNode-shape-diamond-test.js | 2 +- test/drawNode-shape-egg-test.js | 2 +- test/drawNode-shape-ellipse-test.js | 2 +- test/drawNode-shape-none-test.js | 8 +++---- test/drawNode-shape-oval-test.js | 2 +- test/drawNode-shape-point-test.js | 2 +- test/drawNode-shape-polygon-test.js | 2 +- test/drawNode-shape-polygon-worker-test.js | 2 +- test/drawNode-shape-rect-test.js | 2 +- test/drawNode-shape-triangle-test.js | 2 +- test/drawNode-style-invis-test.js | 10 ++++---- test/drawNode-test.js | 22 ++++++++--------- test/engine-test.js | 4 ++-- test/graphviz-options-test.js | 6 ++--- .../graphviz-return-existing-renderer-test.js | 2 +- test/graphviz-test.js | 20 ++++++++-------- test/graphvizVersion-test.js | 2 +- test/graphvizVersion-worker-test.js | 2 +- test/growEnteringEdges-cylinder-test.js | 2 +- test/growEnteringEdges-none-no-label-test.js | 2 +- test/growEnteringEdges-none-test.js | 2 +- test/growEnteringEdges-style-tapered-test.js | 2 +- test/growEnteringEdges-test.js | 2 +- test/keyMode-test.js | 6 ++--- test/logEvents-test.js | 2 +- test/logEvents-worker-test.js | 2 +- test/onerror-test.js | 2 +- test/render-remove-attribute-test.js | 2 +- test/render-test.js | 2 +- .../selectWithoutDataPropagation-test.js | 2 +- test/simple-default-export-test.js | 2 +- test/simple-shared-worker-test.js | 2 +- test/simple-test.js | 2 +- test/simple-worker-local-url-test.js | 2 +- test/simple-worker-test.js | 2 +- test/tooltip-test.js | 4 ++-- test/transition-worker-test.js | 2 +- test/tweenPaths-test.js | 2 +- test/tweenPrecision-test.js | 4 ++-- test/tweenShapes-cylinder-test.js | 2 +- test/tweenShapes-test.js | 2 +- test/width-height-scale-fit-test.js | 2 +- test/zoom-test.js | 24 +++++++++---------- 62 files changed, 128 insertions(+), 128 deletions(-) diff --git a/test/addImage-test.js b/test/addImage-test.js index b5ad8153..9afaf89a 100644 --- a/test/addImage-test.js +++ b/test/addImage-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().addImage() adds images to use in graph.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise((resolve) => { graphviz = d3_graphviz.graphviz("#graph") diff --git a/test/attributer-test.js b/test/attributer-test.js index 746904dc..bbca3111 100644 --- a/test/attributer-test.js +++ b/test/attributer-test.js @@ -4,7 +4,7 @@ import * as d3_graphviz from "../index.js"; it("The attributer is called during rendering.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { diff --git a/test/data-test.js b/test/data-test.js index 4d29c10c..5eb2525f 100644 --- a/test/data-test.js +++ b/test/data-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("data() returns the data saved by dot().", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { diff --git a/test/destroy-shared-worker-test.js b/test/destroy-shared-worker-test.js index 39e0aea7..ad8e415b 100644 --- a/test/destroy-shared-worker-test.js +++ b/test/destroy-shared-worker-test.js @@ -12,7 +12,7 @@ it(".destroy() deletes the Graphviz instance from the container element (shared
`, ); - global.document = window.document; + global.document = window.document; global.SharedWorker = SharedWorker; var graphviz = d3_graphviz.graphviz("#graph", { useSharedWorker: true }); diff --git a/test/destroy-test.js b/test/destroy-test.js index f0bd6572..5df1e2f5 100644 --- a/test/destroy-test.js +++ b/test/destroy-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it(".destroy() deletes the Graphviz instance from the container element", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph", { useWorker: false }); await new Promise(resolve => { diff --git a/test/destroy-worker-test.js b/test/destroy-worker-test.js index e7f6f231..80a68cb1 100644 --- a/test/destroy-worker-test.js +++ b/test/destroy-worker-test.js @@ -12,7 +12,7 @@ it(".destroy() deletes the Graphviz instance from the container element (worker
`, ); - var document = global.document = window.document; + global.document = window.document; global.Blob = function (jsarray) { return new Function(jsarray[0]); } @@ -44,7 +44,7 @@ it(".destroy() closes the worker", async () => {
`, ); - var document = global.document = window.document; + global.document = window.document; var Blob = global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/dot-data-test.js b/test/dot-data-test.js index 0c9096fd..4854ce36 100644 --- a/test/dot-data-test.js +++ b/test/dot-data-test.js @@ -7,7 +7,7 @@ import * as d3_graphviz from "../index.js"; it("data extraction", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { diff --git a/test/dot-empty-node-id-test.js b/test/dot-empty-node-id-test.js index 73309409..e78aa6f3 100644 --- a/test/dot-empty-node-id-test.js +++ b/test/dot-empty-node-id-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("renderDot() renders a node with an empty string as node_id.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); diff --git a/test/dot-no-worker-test.js b/test/dot-no-worker-test.js index e91d7b05..e37a48bc 100644 --- a/test/dot-no-worker-test.js +++ b/test/dot-no-worker-test.js @@ -7,7 +7,7 @@ import Worker from "tiny-worker"; async function do_test(useWorker, html) { var window = global.window = jsdom(html); - var document = global.document = window.document; + global.document = window.document; global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/dot-shared-worker-test.js b/test/dot-shared-worker-test.js index 05f6c383..3b326674 100644 --- a/test/dot-shared-worker-test.js +++ b/test/dot-shared-worker-test.js @@ -23,7 +23,7 @@ describe("dot()", () => { `, ); - var document = global.document = window.document; + global.document = window.document; global.SharedWorker = SharedWorker; graphviz = d3_graphviz.graphviz("#graph", { useSharedWorker: true }); diff --git a/test/dot-viewport-test.js b/test/dot-viewport-test.js index f002e737..b1db9fae 100644 --- a/test/dot-viewport-test.js +++ b/test/dot-viewport-test.js @@ -12,7 +12,7 @@ var bbHeight = simpleHeight - margin * 2; it("DOT without viewport", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -42,7 +42,7 @@ it("DOT without viewport", async () => { it("DOT with viewport scale 2", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -74,7 +74,7 @@ it("DOT with viewport scale 2", async () => { it("DOT with viewport scale 0.5", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -105,7 +105,7 @@ it("DOT with viewport scale 0.5", async () => { it("DOT with viewport scale 1.5", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -137,7 +137,7 @@ it("DOT with viewport scale 1.5", async () => { it("DOT with viewport scale 2 and original size", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz diff --git a/test/dot-worker-test.js b/test/dot-worker-test.js index 48212b1d..61fb5739 100644 --- a/test/dot-worker-test.js +++ b/test/dot-worker-test.js @@ -22,7 +22,7 @@ describe("dot()", () => { `, ); - var document = global.document = window.document; + global.document = window.document; var Blob = global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/dot-worker-through-text-javascript-tag-test.js b/test/dot-worker-through-text-javascript-tag-test.js index fce8b6d9..a4abd5bb 100644 --- a/test/dot-worker-through-text-javascript-tag-test.js +++ b/test/dot-worker-through-text-javascript-tag-test.js @@ -21,7 +21,7 @@ describe("dot()", () => {
`, ); - var document = global.document = window.document; + global.document = window.document; var Blob = global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/drawEdge-style-invis-test.js b/test/drawEdge-style-invis-test.js index a12f1615..1024028e 100644 --- a/test/drawEdge-style-invis-test.js +++ b/test/drawEdge-style-invis-test.js @@ -8,7 +8,7 @@ import {translatePointsAttribute} from "../src/svg.js" it("No edge is drawn when style is invis.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -54,7 +54,7 @@ it("No edge is drawn when style is invis.", async () => { it("Updating of an edge with style invis is ignored.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -101,7 +101,7 @@ it("Updating of an edge with style invis is ignored.", async () => { it("Moving an edge with style invis is ignored.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -147,7 +147,7 @@ it("Moving an edge with style invis is ignored.", async () => { it("Removal of an edge with style invis is allowed.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraph = d3.select("#actual-graph"); @@ -193,7 +193,7 @@ it("Removal of an edge with style invis is allowed.", async () => { it("Changing an edge with style invis to a visible edge is allowed.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawEdge-test.js b/test/drawEdge-test.js index 4e1f4d5e..ebf33dd6 100644 --- a/test/drawEdge-test.js +++ b/test/drawEdge-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("Check our understanding of how Graphviz draws edges.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { @@ -96,7 +96,7 @@ it("Check our understanding of how Graphviz draws edges.", async () => { it("drawEdge() draws an edge in the same way as Graphviz does", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -196,7 +196,7 @@ it("drawEdge() draws an edge in the same way as Graphviz does", async () => { it("drawEdge() draws an edge even if the length is zero", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -239,7 +239,7 @@ it("drawEdge() draws an edge even if the length is zero", async () => { it("drawEdge() draws an edge with an URL attribute in the same way as Graphviz does", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -338,7 +338,7 @@ it("drawEdge() draws an edge with an URL attribute in the same way as Graphviz d it("drawEdge() draws an edge with an tooltip attribute in the same way as Graphviz does", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -437,7 +437,7 @@ it("drawEdge() draws an edge with an tooltip attribute in the same way as Graphv it("insertDrawnEdge() inserts the currently drawn edge into the joined data structure so that it can be animated when the graph is re-rendered", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -495,7 +495,7 @@ it("insertDrawnEdge() inserts the currently drawn edge into the joined data stru it("removeDrawnEdge() removes the edge currently being drawn", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph") await new Promise(resolve => { graphviz @@ -558,7 +558,7 @@ it("removeDrawnEdge() removes the edge currently being drawn", async () => { it("updateDrawnEdge modifies the start and end points and the attributes of an edge", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -634,7 +634,7 @@ it("updateDrawnEdge modifies the start and end points and the attributes of an e it("moveDrawnEdgeEndPoint modifies the end points of an edge", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -692,7 +692,7 @@ it("moveDrawnEdgeEndPoint modifies the end points of an edge", async () => { it("drawnEdgeSelection return a selection containing the edge currently being drawn", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz @@ -747,7 +747,7 @@ it("drawnEdgeSelection return a selection containing the edge currently being dr it("Attempts to operate on an edge without drawing one first is handled gracefully", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz diff --git a/test/drawNode-shape-box-test.js b/test/drawNode-shape-box-test.js index df7370d3..35eb17c9 100644 --- a/test/drawNode-shape-box-test.js +++ b/test/drawNode-shape-box-test.js @@ -8,7 +8,7 @@ import {translatePointsAttribute} from "../src/svg.js" it("Verify that box shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-circle-test.js b/test/drawNode-shape-circle-test.js index 702c09d4..080e20c0 100644 --- a/test/drawNode-shape-circle-test.js +++ b/test/drawNode-shape-circle-test.js @@ -7,7 +7,7 @@ import * as d3_graphviz from "../index.js"; it("Verify that circle shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-cylinder-test.js b/test/drawNode-shape-cylinder-test.js index 16c33c95..0da9bf70 100644 --- a/test/drawNode-shape-cylinder-test.js +++ b/test/drawNode-shape-cylinder-test.js @@ -8,7 +8,7 @@ import {translateDAttribute} from "../src/svg.js" it("Verify that cylinder shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-default-test.js b/test/drawNode-shape-default-test.js index ba43bf26..08ee7f62 100644 --- a/test/drawNode-shape-default-test.js +++ b/test/drawNode-shape-default-test.js @@ -7,7 +7,7 @@ import * as d3_graphviz from "../index.js"; it("Verify that default shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); @@ -85,7 +85,7 @@ it("Verify that default shape is drawn exactly as Graphviz does.", async () => { it("Verify that default shape with style filled is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -162,7 +162,7 @@ it("Verify that default shape with style filled is drawn exactly as Graphviz doe it("Default shape with style filled without fillcolor, but with color, uses color as fillcolor.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -241,7 +241,7 @@ it("Default shape with style filled without fillcolor, but with color, uses colo it("Verify that default shape with label is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-diamond-test.js b/test/drawNode-shape-diamond-test.js index 6f42b7e2..927d732e 100644 --- a/test/drawNode-shape-diamond-test.js +++ b/test/drawNode-shape-diamond-test.js @@ -8,7 +8,7 @@ import {translatePointsAttribute} from "../src/svg.js" it("Verify that diamond shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-egg-test.js b/test/drawNode-shape-egg-test.js index dfba1ab9..380fa5f5 100644 --- a/test/drawNode-shape-egg-test.js +++ b/test/drawNode-shape-egg-test.js @@ -8,7 +8,7 @@ import {translatePointsAttribute} from "../src/svg.js" it("Verify that egg shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-ellipse-test.js b/test/drawNode-shape-ellipse-test.js index 0048d27a..670773e8 100644 --- a/test/drawNode-shape-ellipse-test.js +++ b/test/drawNode-shape-ellipse-test.js @@ -7,7 +7,7 @@ import * as d3_graphviz from "../index.js"; it("Verify that ellipse shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-none-test.js b/test/drawNode-shape-none-test.js index 45deb513..d08d074b 100644 --- a/test/drawNode-shape-none-test.js +++ b/test/drawNode-shape-none-test.js @@ -8,7 +8,7 @@ import {translatePointsAttribute} from "../src/svg.js" it("Verify that none shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -82,7 +82,7 @@ it("Verify that none shape is drawn exactly as Graphviz does.", async () => { it("Verify that none shape without label is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -144,7 +144,7 @@ it("Verify that none shape without label is drawn exactly as Graphviz does.", as it("Verify that none shape with style filled is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -221,7 +221,7 @@ it("Verify that none shape with style filled is drawn exactly as Graphviz does." it("Verify that none shape with style filled and pen color specified is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-oval-test.js b/test/drawNode-shape-oval-test.js index 5015f622..0b0dea57 100644 --- a/test/drawNode-shape-oval-test.js +++ b/test/drawNode-shape-oval-test.js @@ -7,7 +7,7 @@ import * as d3_graphviz from "../index.js"; it("Verify that oval shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-point-test.js b/test/drawNode-shape-point-test.js index 7cac1c02..db599ffc 100644 --- a/test/drawNode-shape-point-test.js +++ b/test/drawNode-shape-point-test.js @@ -7,7 +7,7 @@ import * as d3_graphviz from "../index.js"; it("Verify that point shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-polygon-test.js b/test/drawNode-shape-polygon-test.js index 32c711a8..b824bd4a 100644 --- a/test/drawNode-shape-polygon-test.js +++ b/test/drawNode-shape-polygon-test.js @@ -8,7 +8,7 @@ import {translatePointsAttribute} from "../src/svg.js" it("Verify that polygon shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-polygon-worker-test.js b/test/drawNode-shape-polygon-worker-test.js index 3d068d1e..b06ef384 100644 --- a/test/drawNode-shape-polygon-worker-test.js +++ b/test/drawNode-shape-polygon-worker-test.js @@ -24,7 +24,7 @@ describe("drawNode()", () => {
`, ); - var document = global.document = window.document; + global.document = window.document; var Blob = global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/drawNode-shape-rect-test.js b/test/drawNode-shape-rect-test.js index d1fd3028..267e8fde 100644 --- a/test/drawNode-shape-rect-test.js +++ b/test/drawNode-shape-rect-test.js @@ -8,7 +8,7 @@ import {translatePointsAttribute} from "../src/svg.js" it("Verify that rect shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-shape-triangle-test.js b/test/drawNode-shape-triangle-test.js index c0c389d3..0e2f7875 100644 --- a/test/drawNode-shape-triangle-test.js +++ b/test/drawNode-shape-triangle-test.js @@ -9,7 +9,7 @@ import {roundTo2Decimals} from "./utils.js"; it("Verify that triangle shape is drawn exactly as Graphviz does.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-style-invis-test.js b/test/drawNode-style-invis-test.js index f8e594e6..0f04540a 100644 --- a/test/drawNode-style-invis-test.js +++ b/test/drawNode-style-invis-test.js @@ -8,7 +8,7 @@ import {translatePointsAttribute} from "../src/svg.js"; it("No node is drawn when style is invis.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -58,7 +58,7 @@ it("No node is drawn when style is invis.", async () => { it("Updating of a node with style invis is ignored.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -103,7 +103,7 @@ it("Updating of a node with style invis is ignored.", async () => { it("Moving a node with style invis is ignored.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; @@ -148,7 +148,7 @@ it("Moving a node with style invis is ignored.", async () => { it("Removal of a node with style invis is allowed.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraph = d3.select("#actual-graph"); @@ -193,7 +193,7 @@ it("Removal of a node with style invis is allowed.", async () => { it("Changing a node with style invis to a visible node is allowed.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var expectedGraph = d3.select("#expected-graph"); var actualGraph = d3.select("#actual-graph"); var actualGraphviz; diff --git a/test/drawNode-test.js b/test/drawNode-test.js index d8a07f90..80139c58 100644 --- a/test/drawNode-test.js +++ b/test/drawNode-test.js @@ -7,7 +7,7 @@ import {translatePointsAttribute} from "../src/svg.js"; it("Check our understanding of how Graphviz draws nodes.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -44,7 +44,7 @@ it("Check our understanding of how Graphviz draws nodes.", async () => { it("drawNode() draws a node in the same way as Graphviz does", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -100,7 +100,7 @@ it("drawNode() draws a node in the same way as Graphviz does", async () => { it("drawNode() draws a polygon node", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -154,7 +154,7 @@ it("drawNode() draws a polygon node", async () => { it("drawNode() draws a node with an URL attribute in the same way as Graphviz does", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -209,7 +209,7 @@ it("drawNode() draws a node with an URL attribute in the same way as Graphviz do it("drawNode() draws a node with an tooltip attribute in the same way as Graphviz does", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -263,7 +263,7 @@ it("drawNode() draws a node with an tooltip attribute in the same way as Graphvi it("insertDrawnNode() inserts the currently drawn node into the joined data structure so that it can be animated when the graph is re-rendered", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -318,7 +318,7 @@ it("insertDrawnNode() inserts the currently drawn node into the joined data stru it("removeDrawnNode() removes the node currently being drawn", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -377,7 +377,7 @@ it("removeDrawnNode() removes the node currently being drawn", async () => { it("updateDrawnNode modifies the position, size and attributes of a node", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -504,7 +504,7 @@ it("updateDrawnNode modifies the position, size and attributes of a node", async it("moveDrawnNode modifies the position of a node", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -555,7 +555,7 @@ it("moveDrawnNode modifies the position of a node", async () => { it("drawnNodeSelection return a selection containing the node currently being drawn", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -606,7 +606,7 @@ it("drawnNodeSelection return a selection containing the node currently being dr it("Attempts to operate on a node without drawing one first is handled gracefully", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { diff --git a/test/engine-test.js b/test/engine-test.js index ed40e195..fde1d62a 100644 --- a/test/engine-test.js +++ b/test/engine-test.js @@ -6,7 +6,7 @@ import * as d3_selection from "d3-selection"; it("engine() selects which graphviz layout engine to use.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; @@ -29,7 +29,7 @@ it("engine() selects which graphviz layout engine to use.", async () => { it("engine() selects which graphviz layout engine to use.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { diff --git a/test/graphviz-options-test.js b/test/graphviz-options-test.js index 27d45545..7a60a89b 100644 --- a/test/graphviz-options-test.js +++ b/test/graphviz-options-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().options() gets options.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var defaultOptions = { tweenShapes: true, totalMemory: undefined, @@ -20,7 +20,7 @@ it("graphviz().options() gets options.", async () => { it("graphviz(options) sets options at initialization.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var setOptions = { tweenShapes: false, totalMemory: 65536, @@ -34,7 +34,7 @@ it("graphviz(options) sets options at initialization.", async () => { it("graphviz().options(options) sets options.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var setOptions1 = { tweenShapes: false, totalMemory: 255, diff --git a/test/graphviz-return-existing-renderer-test.js b/test/graphviz-return-existing-renderer-test.js index 422d971a..d5a04290 100644 --- a/test/graphviz-return-existing-renderer-test.js +++ b/test/graphviz-return-existing-renderer-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz() returns an exiting renderer.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz1; await new Promise(resolve => { diff --git a/test/graphviz-test.js b/test/graphviz-test.js index 845adb22..fbbe7e34 100644 --- a/test/graphviz-test.js +++ b/test/graphviz-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().render() renders an SVG from graphviz DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { graphviz.on("initEnd", resolve); @@ -81,7 +81,7 @@ it("graphviz().render() renders an SVG from graphviz DOT.", async () => { it("graphviz().render() renders on a div with sub-elements", async () => { var window = global.window = jsdom('
Hello World
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -132,7 +132,7 @@ it("graphviz().render() renders on a div with sub-elements", async () => { it("graphviz().render() removes SVG elements for nodes and edges when removed from updated DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -177,7 +177,7 @@ it("graphviz().render() removes SVG elements for nodes and edges when removed fr it("graphviz().render() adds SVG elements for nodes and edges when added to updated DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -209,7 +209,7 @@ it("graphviz().render() adds SVG elements for nodes and edges when added to upda it("graphviz().renderDot() renders an SVG from graphviz DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -234,7 +234,7 @@ it("graphviz().renderDot() renders an SVG from graphviz DOT.", async () => { it("graphviz().render() updates SVG text element when node name changes in DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -268,7 +268,7 @@ it("graphviz().render() updates SVG text element when node name changes in DOT." it("graphviz().render() changes SVG element type when node shape changes in DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -306,7 +306,7 @@ it("graphviz().render() changes SVG element type when node shape changes in DOT. it("graphviz().renderDot() renders an SVG from graphviz strict undirectd DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -345,7 +345,7 @@ it("graphviz().renderDot() renders an SVG from graphviz strict undirectd DOT.", it("graphviz().renderDot() renders an SVG from graphviz strict directd DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -384,7 +384,7 @@ it("graphviz().renderDot() renders an SVG from graphviz strict directd DOT.", as it("graphviz().render() renders edges with tooltip attribute.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { diff --git a/test/graphvizVersion-test.js b/test/graphvizVersion-test.js index 2a63b6fe..ffe1690c 100644 --- a/test/graphvizVersion-test.js +++ b/test/graphvizVersion-test.js @@ -5,7 +5,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().graphvizVersion() return the Graphviz version.", async () => { global.window = jsdom('
'); - global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/graphvizVersion-worker-test.js b/test/graphvizVersion-worker-test.js index 0abb52d7..63aee1d9 100644 --- a/test/graphvizVersion-worker-test.js +++ b/test/graphvizVersion-worker-test.js @@ -20,7 +20,7 @@ describe("graphvizVersion()", () => {
`, ); - var document = global.document = window.document; + global.document = window.document; var Blob = global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/growEnteringEdges-cylinder-test.js b/test/growEnteringEdges-cylinder-test.js index 6f25e106..ed09cfbc 100644 --- a/test/growEnteringEdges-cylinder-test.js +++ b/test/growEnteringEdges-cylinder-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().render() renders growing edges to nodes with URL attribute.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/growEnteringEdges-none-no-label-test.js b/test/growEnteringEdges-none-no-label-test.js index 48a400b3..fc10bf04 100644 --- a/test/growEnteringEdges-none-no-label-test.js +++ b/test/growEnteringEdges-none-no-label-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().render() renders growing edges from nodes with shape none and no labels.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/growEnteringEdges-none-test.js b/test/growEnteringEdges-none-test.js index 6463d93d..29d6bbac 100644 --- a/test/growEnteringEdges-none-test.js +++ b/test/growEnteringEdges-none-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().render() renders growing edges from nodes with shape none.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/growEnteringEdges-style-tapered-test.js b/test/growEnteringEdges-style-tapered-test.js index 8f007ab4..1d5a2622 100644 --- a/test/growEnteringEdges-style-tapered-test.js +++ b/test/growEnteringEdges-style-tapered-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("Simple rendering an SVG from graphviz DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/growEnteringEdges-test.js b/test/growEnteringEdges-test.js index b870440d..6d06a91b 100644 --- a/test/growEnteringEdges-test.js +++ b/test/growEnteringEdges-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().render() renders growing edges to nodes with URL attribute.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/keyMode-test.js b/test/keyMode-test.js index 9b2f4c2d..1d51bdc5 100644 --- a/test/keyMode-test.js +++ b/test/keyMode-test.js @@ -7,7 +7,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().keyMode() affects transitions and order of rendering.", async function () { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var keyModes = [ 'title', 'tag-index', @@ -176,7 +176,7 @@ it("graphviz().keyMode() affects transitions and order of rendering.", async fun it("graphviz().keyMode() does not accept illegal key modes.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -200,7 +200,7 @@ it("graphviz().keyMode() does not accept illegal key modes.", async () => { it("graphviz().keyMode() cannot be changed after applying dot source.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { diff --git a/test/logEvents-test.js b/test/logEvents-test.js index 89a45a2c..6d0287d3 100644 --- a/test/logEvents-test.js +++ b/test/logEvents-test.js @@ -6,7 +6,7 @@ import * as d3_transition from "d3-transition"; it("logEvents enables and disables event logging.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/logEvents-worker-test.js b/test/logEvents-worker-test.js index 9ff94471..5007eccd 100644 --- a/test/logEvents-worker-test.js +++ b/test/logEvents-worker-test.js @@ -20,7 +20,7 @@ describe("logEvents())", () => {
`, ); - global.document = window.document; + global.document = window.document; global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/onerror-test.js b/test/onerror-test.js index d57560da..684f5345 100644 --- a/test/onerror-test.js +++ b/test/onerror-test.js @@ -5,7 +5,7 @@ import * as d3_graphviz from "../index.js"; it("onerror() registers dot layout error handler.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { diff --git a/test/render-remove-attribute-test.js b/test/render-remove-attribute-test.js index f726c166..84d5249b 100644 --- a/test/render-remove-attribute-test.js +++ b/test/render-remove-attribute-test.js @@ -8,7 +8,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().render() removes attribute from SVG element when attribute is removed from Graphviz node.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/render-test.js b/test/render-test.js index a2eda2f2..ef0e6fa1 100644 --- a/test/render-test.js +++ b/test/render-test.js @@ -8,7 +8,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().render() adds and removes SVG elements after transition delay.", async () => { var window = global.window = jsdom('
Hello World
'); - var document = global.document = window.document + global.document = window.document var graphviz; diff --git a/test/selection/selectWithoutDataPropagation-test.js b/test/selection/selectWithoutDataPropagation-test.js index ccda5cf2..653d7971 100644 --- a/test/selection/selectWithoutDataPropagation-test.js +++ b/test/selection/selectWithoutDataPropagation-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../../index.js"; it("selection.selectWithoutDataPropagation() selects without propagating data", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var parent = d3_selection.select("#parent"); parent diff --git a/test/simple-default-export-test.js b/test/simple-default-export-test.js index 46c87541..9947d7ea 100644 --- a/test/simple-default-export-test.js +++ b/test/simple-default-export-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "d3-graphviz"; it("Simple rendering an SVG from graphviz DOT using default export", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/simple-shared-worker-test.js b/test/simple-shared-worker-test.js index 106859eb..cc62d2e9 100644 --- a/test/simple-shared-worker-test.js +++ b/test/simple-shared-worker-test.js @@ -20,7 +20,7 @@ describe("renderDot()", () => {
`, ); - var document = global.document = window.document; + global.document = window.document; global.SharedWorker = SharedWorker; diff --git a/test/simple-test.js b/test/simple-test.js index 5a9653eb..ff680cf0 100644 --- a/test/simple-test.js +++ b/test/simple-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("Simple rendering an SVG from graphviz DOT.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/simple-worker-local-url-test.js b/test/simple-worker-local-url-test.js index c5a10586..187067dd 100644 --- a/test/simple-worker-local-url-test.js +++ b/test/simple-worker-local-url-test.js @@ -23,7 +23,7 @@ describe("renderDot()", () => { url: "http:dummyhost", }, ); - var document = global.document = window.document; + global.document = window.document; var Blob = global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/simple-worker-test.js b/test/simple-worker-test.js index a9f1315e..0e794ef3 100644 --- a/test/simple-worker-test.js +++ b/test/simple-worker-test.js @@ -20,7 +20,7 @@ describe("renderDot()", () => {
`, ); - var document = global.document = window.document; + global.document = window.document; var Blob = global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/tooltip-test.js b/test/tooltip-test.js index b96897af..fd68ac90 100644 --- a/test/tooltip-test.js +++ b/test/tooltip-test.js @@ -7,7 +7,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz.renderDot() generates a correct SVG from graphviz DOT with graph tooltip.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -36,7 +36,7 @@ it("graphviz.renderDot() generates a correct SVG from graphviz DOT with graph to it("graphviz.transition().renderDot() generates a correct SVG from graphviz DOT with graph tooltip.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { diff --git a/test/transition-worker-test.js b/test/transition-worker-test.js index 629bea77..6b623591 100644 --- a/test/transition-worker-test.js +++ b/test/transition-worker-test.js @@ -23,7 +23,7 @@ describe("render()", () => {
`, ); - var document = global.document = window.document; + global.document = window.document; var Blob = global.Blob = function (jsarray) { return new Function(jsarray[0]); } diff --git a/test/tweenPaths-test.js b/test/tweenPaths-test.js index d49ac585..b831d202 100644 --- a/test/tweenPaths-test.js +++ b/test/tweenPaths-test.js @@ -8,7 +8,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().tweenPaths(true) enables path tweening during transitions.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/tweenPrecision-test.js b/test/tweenPrecision-test.js index d298c9a3..ac277b3e 100644 --- a/test/tweenPrecision-test.js +++ b/test/tweenPrecision-test.js @@ -8,7 +8,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().tweenPrecision can be absolute.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -79,7 +79,7 @@ it("graphviz().tweenPrecision can be relative.", async () => { var graphviz; var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; await new Promise(resolve => { graphviz = d3_graphviz.graphviz("#graph") .on("initEnd", resolve); diff --git a/test/tweenShapes-cylinder-test.js b/test/tweenShapes-cylinder-test.js index b3d6cb3d..49a5aada 100644 --- a/test/tweenShapes-cylinder-test.js +++ b/test/tweenShapes-cylinder-test.js @@ -8,7 +8,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().tweenShapes() enables and disables shape tweening during transitions.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph"); await new Promise(resolve => { diff --git a/test/tweenShapes-test.js b/test/tweenShapes-test.js index 57843f6b..a2dfa4bd 100644 --- a/test/tweenShapes-test.js +++ b/test/tweenShapes-test.js @@ -8,7 +8,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().tweenShapes() enables and disables shape tweening during transitions.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { diff --git a/test/width-height-scale-fit-test.js b/test/width-height-scale-fit-test.js index 8b3d1936..3fc2b12e 100644 --- a/test/width-height-scale-fit-test.js +++ b/test/width-height-scale-fit-test.js @@ -6,7 +6,7 @@ import * as d3_graphviz from "../index.js"; it("graphviz().width() sets svg width.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; diff --git a/test/zoom-test.js b/test/zoom-test.js index 6878e0fb..a26c7d26 100644 --- a/test/zoom-test.js +++ b/test/zoom-test.js @@ -8,7 +8,7 @@ import * as d3_selection from "d3-selection"; it("zoom(false) disables zooming.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -26,7 +26,7 @@ it("zoom(false) disables zooming.", async () => { it("zoom(true) enables zooming.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -49,7 +49,7 @@ it("zoom(true) enables zooming.", async () => { it("zoom(false) after zoom(true) disables zooming.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -79,7 +79,7 @@ it("zoom(false) after zoom(true) disables zooming.", async () => { it("resetZoom resets the zoom transform to the original transform.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -163,7 +163,7 @@ it("resetZoom resets the zoom transform to the original transform.", async () => it("resetZoom resets the zoom transform to the original transform of the latest rendered graph.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -253,7 +253,7 @@ it("resetZoom resets the zoom transform to the original transform of the latest it("zooming rescales transforms during transitions.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -322,7 +322,7 @@ it("zooming rescales transforms during transitions.", async () => { it("zoomScaleExtent() sets zoom scale extent.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -341,7 +341,7 @@ it("zoomScaleExtent() sets zoom scale extent.", async () => { it("zoomTranslateExtent() sets zoom translate extent.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -361,7 +361,7 @@ it("zoomTranslateExtent() sets zoom translate extent.", async () => { it("zoomBehavior() returns the current zoom behavior if zoom is enabled.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -379,7 +379,7 @@ it("zoomBehavior() returns the current zoom behavior if zoom is enabled.", async it("zoomBehavior() returns null if zoom is disabled.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -397,7 +397,7 @@ it("zoomBehavior() returns null if zoom is disabled.", async () => { it("zoomSelection() returns the current zoom selection if zoom is enabled.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { @@ -415,7 +415,7 @@ it("zoomSelection() returns the current zoom selection if zoom is enabled.", asy it("zoomSelection() returns null if zoom is disabled.", async () => { var window = global.window = jsdom('
'); - var document = global.document = window.document; + global.document = window.document; var graphviz; await new Promise(resolve => { From b7f32627487f84f0cf4bbe2227b059e11f7f3649 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 22 Jan 2023 17:41:34 +0100 Subject: [PATCH 2/8] remove useless 'Blob' variable in tests --- test/destroy-worker-test.js | 2 +- test/dot-worker-test.js | 2 +- test/dot-worker-through-text-javascript-tag-test.js | 2 +- test/drawNode-shape-polygon-worker-test.js | 2 +- test/graphvizVersion-worker-test.js | 2 +- test/simple-worker-local-url-test.js | 2 +- test/simple-worker-test.js | 2 +- test/transition-worker-test.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/destroy-worker-test.js b/test/destroy-worker-test.js index 80a68cb1..348b6a53 100644 --- a/test/destroy-worker-test.js +++ b/test/destroy-worker-test.js @@ -45,7 +45,7 @@ it(".destroy() closes the worker", async () => { `, ); global.document = window.document; - var Blob = global.Blob = function (jsarray) { + global.Blob = function (jsarray) { return new Function(jsarray[0]); } var createObjectURL = window.URL.createObjectURL = function (js) { diff --git a/test/dot-worker-test.js b/test/dot-worker-test.js index 61fb5739..ab86ae35 100644 --- a/test/dot-worker-test.js +++ b/test/dot-worker-test.js @@ -23,7 +23,7 @@ describe("dot()", () => { ); global.document = window.document; - var Blob = global.Blob = function (jsarray) { + global.Blob = function (jsarray) { return new Function(jsarray[0]); } var createObjectURL = window.URL.createObjectURL = function (js) { diff --git a/test/dot-worker-through-text-javascript-tag-test.js b/test/dot-worker-through-text-javascript-tag-test.js index a4abd5bb..a1a33b4f 100644 --- a/test/dot-worker-through-text-javascript-tag-test.js +++ b/test/dot-worker-through-text-javascript-tag-test.js @@ -22,7 +22,7 @@ describe("dot()", () => { `, ); global.document = window.document; - var Blob = global.Blob = function (jsarray) { + global.Blob = function (jsarray) { return new Function(jsarray[0]); } var createObjectURL = window.URL.createObjectURL = function (js) { diff --git a/test/drawNode-shape-polygon-worker-test.js b/test/drawNode-shape-polygon-worker-test.js index b06ef384..cb70ef0c 100644 --- a/test/drawNode-shape-polygon-worker-test.js +++ b/test/drawNode-shape-polygon-worker-test.js @@ -25,7 +25,7 @@ describe("drawNode()", () => { `, ); global.document = window.document; - var Blob = global.Blob = function (jsarray) { + global.Blob = function (jsarray) { return new Function(jsarray[0]); } var createObjectURL = window.URL.createObjectURL = function (js) { diff --git a/test/graphvizVersion-worker-test.js b/test/graphvizVersion-worker-test.js index 63aee1d9..030823e7 100644 --- a/test/graphvizVersion-worker-test.js +++ b/test/graphvizVersion-worker-test.js @@ -21,7 +21,7 @@ describe("graphvizVersion()", () => { `, ); global.document = window.document; - var Blob = global.Blob = function (jsarray) { + global.Blob = function (jsarray) { return new Function(jsarray[0]); } var createObjectURL = window.URL.createObjectURL = function (js) { diff --git a/test/simple-worker-local-url-test.js b/test/simple-worker-local-url-test.js index 187067dd..c721becd 100644 --- a/test/simple-worker-local-url-test.js +++ b/test/simple-worker-local-url-test.js @@ -24,7 +24,7 @@ describe("renderDot()", () => { }, ); global.document = window.document; - var Blob = global.Blob = function (jsarray) { + global.Blob = function (jsarray) { return new Function(jsarray[0]); } var createObjectURL = window.URL.createObjectURL = function (js) { diff --git a/test/simple-worker-test.js b/test/simple-worker-test.js index 0e794ef3..ba947d5b 100644 --- a/test/simple-worker-test.js +++ b/test/simple-worker-test.js @@ -21,7 +21,7 @@ describe("renderDot()", () => { `, ); global.document = window.document; - var Blob = global.Blob = function (jsarray) { + global.Blob = function (jsarray) { return new Function(jsarray[0]); } var createObjectURL = window.URL.createObjectURL = function (js) { diff --git a/test/transition-worker-test.js b/test/transition-worker-test.js index 6b623591..b67a9122 100644 --- a/test/transition-worker-test.js +++ b/test/transition-worker-test.js @@ -24,7 +24,7 @@ describe("render()", () => { `, ); global.document = window.document; - var Blob = global.Blob = function (jsarray) { + global.Blob = function (jsarray) { return new Function(jsarray[0]); } var createObjectURL = window.URL.createObjectURL = function (js) { From eb7d881377ed3cbeff7123fb3059852e186b168f Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 22 Jan 2023 17:43:58 +0100 Subject: [PATCH 3/8] remove useless 'createObjectURL' variable in tests --- test/destroy-worker-test.js | 2 +- test/dot-worker-test.js | 2 +- test/dot-worker-through-text-javascript-tag-test.js | 2 +- test/drawNode-shape-polygon-worker-test.js | 2 +- test/graphvizVersion-worker-test.js | 2 +- test/simple-worker-local-url-test.js | 2 +- test/simple-worker-test.js | 2 +- test/transition-worker-test.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/destroy-worker-test.js b/test/destroy-worker-test.js index 348b6a53..b71e52dc 100644 --- a/test/destroy-worker-test.js +++ b/test/destroy-worker-test.js @@ -48,7 +48,7 @@ it(".destroy() closes the worker", async () => { global.Blob = function (jsarray) { return new Function(jsarray[0]); } - var createObjectURL = window.URL.createObjectURL = function (js) { + window.URL.createObjectURL = function (js) { return js; } global.Worker = Worker; diff --git a/test/dot-worker-test.js b/test/dot-worker-test.js index ab86ae35..0b3d69db 100644 --- a/test/dot-worker-test.js +++ b/test/dot-worker-test.js @@ -26,7 +26,7 @@ describe("dot()", () => { global.Blob = function (jsarray) { return new Function(jsarray[0]); } - var createObjectURL = window.URL.createObjectURL = function (js) { + window.URL.createObjectURL = function (js) { return js; } global.Worker = Worker; diff --git a/test/dot-worker-through-text-javascript-tag-test.js b/test/dot-worker-through-text-javascript-tag-test.js index a1a33b4f..ca990e7f 100644 --- a/test/dot-worker-through-text-javascript-tag-test.js +++ b/test/dot-worker-through-text-javascript-tag-test.js @@ -25,7 +25,7 @@ describe("dot()", () => { global.Blob = function (jsarray) { return new Function(jsarray[0]); } - var createObjectURL = window.URL.createObjectURL = function (js) { + window.URL.createObjectURL = function (js) { return js; } global.Worker = Worker; diff --git a/test/drawNode-shape-polygon-worker-test.js b/test/drawNode-shape-polygon-worker-test.js index cb70ef0c..ef779279 100644 --- a/test/drawNode-shape-polygon-worker-test.js +++ b/test/drawNode-shape-polygon-worker-test.js @@ -28,7 +28,7 @@ describe("drawNode()", () => { global.Blob = function (jsarray) { return new Function(jsarray[0]); } - var createObjectURL = window.URL.createObjectURL = function (js) { + window.URL.createObjectURL = function (js) { return js; } global.SharedWorker = SharedWorker; diff --git a/test/graphvizVersion-worker-test.js b/test/graphvizVersion-worker-test.js index 030823e7..96991567 100644 --- a/test/graphvizVersion-worker-test.js +++ b/test/graphvizVersion-worker-test.js @@ -24,7 +24,7 @@ describe("graphvizVersion()", () => { global.Blob = function (jsarray) { return new Function(jsarray[0]); } - var createObjectURL = window.URL.createObjectURL = function (js) { + window.URL.createObjectURL = function (js) { return js; } global.Worker = Worker; diff --git a/test/simple-worker-local-url-test.js b/test/simple-worker-local-url-test.js index c721becd..176915f8 100644 --- a/test/simple-worker-local-url-test.js +++ b/test/simple-worker-local-url-test.js @@ -27,7 +27,7 @@ describe("renderDot()", () => { global.Blob = function (jsarray) { return new Function(jsarray[0]); } - var createObjectURL = window.URL.createObjectURL = function (js) { + window.URL.createObjectURL = function (js) { return js; } global.Worker = Worker; diff --git a/test/simple-worker-test.js b/test/simple-worker-test.js index ba947d5b..e7eccbf5 100644 --- a/test/simple-worker-test.js +++ b/test/simple-worker-test.js @@ -24,7 +24,7 @@ describe("renderDot()", () => { global.Blob = function (jsarray) { return new Function(jsarray[0]); } - var createObjectURL = window.URL.createObjectURL = function (js) { + window.URL.createObjectURL = function (js) { return js; } global.Worker = Worker; diff --git a/test/transition-worker-test.js b/test/transition-worker-test.js index b67a9122..d7d0dafe 100644 --- a/test/transition-worker-test.js +++ b/test/transition-worker-test.js @@ -27,7 +27,7 @@ describe("render()", () => { global.Blob = function (jsarray) { return new Function(jsarray[0]); } - var createObjectURL = window.URL.createObjectURL = function (js) { + window.URL.createObjectURL = function (js) { return js; } global.Worker = Worker; From b39231dd3285ea11dd4d0a3da0d39dc62cd4d63c Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 22 Jan 2023 10:36:17 +0100 Subject: [PATCH 4/8] remove useless imports in test/drawEdge-style-invis-test.js --- test/drawEdge-style-invis-test.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/drawEdge-style-invis-test.js b/test/drawEdge-style-invis-test.js index 1024028e..0d69fbd2 100644 --- a/test/drawEdge-style-invis-test.js +++ b/test/drawEdge-style-invis-test.js @@ -1,10 +1,8 @@ import assert from "assert"; import it from "./it.js"; import jsdom from "./jsdom.js"; -import deepEqualData from "./deepEqualData.js"; import * as d3 from "d3-selection"; import * as d3_graphviz from "../index.js"; -import {translatePointsAttribute} from "../src/svg.js" it("No edge is drawn when style is invis.", async () => { var window = global.window = jsdom('
'); From 5b4d0340b5039e5a0eb35ca7190e3ea1eac14f3d Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 22 Jan 2023 10:42:49 +0100 Subject: [PATCH 5/8] remove useless import in test/graphviz-return-existing-renderer-test.js --- test/graphviz-return-existing-renderer-test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/graphviz-return-existing-renderer-test.js b/test/graphviz-return-existing-renderer-test.js index d5a04290..802840ca 100644 --- a/test/graphviz-return-existing-renderer-test.js +++ b/test/graphviz-return-existing-renderer-test.js @@ -1,7 +1,6 @@ import assert from "assert"; import it from "./it.js"; import jsdom from "./jsdom.js"; -import * as d3 from "d3-selection"; import * as d3_graphviz from "../index.js"; it("graphviz() returns an exiting renderer.", async () => { From 0e763b49f132b90e22475487ad3753c5d4455d19 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 22 Jan 2023 10:44:17 +0100 Subject: [PATCH 6/8] remove useless import in test/render-remove-attribute-test.js --- test/render-remove-attribute-test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/render-remove-attribute-test.js b/test/render-remove-attribute-test.js index 84d5249b..4966b390 100644 --- a/test/render-remove-attribute-test.js +++ b/test/render-remove-attribute-test.js @@ -2,7 +2,6 @@ import assert from "assert"; import it from "./it.js"; import jsdom from "./jsdom.js"; import * as d3 from "d3-selection"; -import * as d3_transition from "d3-transition"; import * as d3_graphviz from "../index.js"; it("graphviz().render() removes attribute from SVG element when attribute is removed from Graphviz node.", async () => { From c33358c587b9a779dd5c2bbd46fb67304968bc22 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 22 Jan 2023 10:47:13 +0100 Subject: [PATCH 7/8] remove useless import in test/selection/selectWithoutDataPropagation-test.js --- test/selection/selectWithoutDataPropagation-test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/selection/selectWithoutDataPropagation-test.js b/test/selection/selectWithoutDataPropagation-test.js index 653d7971..4db38135 100644 --- a/test/selection/selectWithoutDataPropagation-test.js +++ b/test/selection/selectWithoutDataPropagation-test.js @@ -2,7 +2,6 @@ import assert from "assert"; import it from "../it.js"; import jsdom from "../jsdom.js"; import * as d3_selection from "d3-selection"; -import * as d3_graphviz from "../../index.js"; it("selection.selectWithoutDataPropagation() selects without propagating data", async () => { var window = global.window = jsdom('
'); From 508d58fdbbbec7eeed81d205f5b090376fbc7d61 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 22 Jan 2023 10:47:00 +0100 Subject: [PATCH 8/8] remove surplus blank line in test/addImage-test.js --- test/addImage-test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/addImage-test.js b/test/addImage-test.js index 9afaf89a..02123c18 100644 --- a/test/addImage-test.js +++ b/test/addImage-test.js @@ -3,7 +3,6 @@ import jsdom from "./jsdom.js"; import * as d3 from "d3-selection"; import * as d3_graphviz from "../index.js"; - it("graphviz().addImage() adds images to use in graph.", async () => { var window = global.window = jsdom('
'); global.document = window.document;