Skip to content

Commit

Permalink
Add test for single-series diverging.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Mar 19, 2019
1 parent 93e7e26 commit 18faa43
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/offset/diverging-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ tape("stackOffsetDiverging(series, order) applies a zero baseline, ignoring exis
test.end();
});

tape.only("stackOffsetDiverging(series, order) handles a single series", function(test) {
var series = [
[[1, 2], [2, 4], [3, 4]]
];
shape.stackOffsetDiverging(series, shape.stackOrderNone(series));
test.deepEqual(series, [
[[0, 1], [0, 2], [0, 1]]
]);
test.end();
});

tape("stackOffsetDiverging(series, order) treats NaN as zero", function(test) {
var series = [
[[0, 1], [0, 2], [0, 1]],
Expand Down

0 comments on commit 18faa43

Please sign in to comment.