Debian Codegraph @

topojson/test/bounds-test.js

raw
1 var tape = require("tape"),
2 bounds = require("../lib/topojson/bounds");
3
4 tape("bounds computes the bounding box", function(test) {
5 test.deepEqual(bounds({
6 foo: {
7 type: "LineString",
8 coordinates: [[0, 0], [1, 0], [0, 2], [0, 0]]
9 }
10 }), [0, 0, 1, 2]);
11 test.end();
12 });
13
14 tape("bounds considers points as well as arcs", function(test) {
15 test.deepEqual(bounds({
16 foo: {
17 type: "MultiPoint",
18 coordinates: [[0, 0], [1, 0], [0, 2], [0, 0]]
19 }
20 }), [0, 0, 1, 2]);
21 test.end();
22 });