Skip to content

Commit

Permalink
Made unit test messages more descriptive and added to contributors.
Browse files Browse the repository at this point in the history
  • Loading branch information
smallsaucepan committed Dec 16, 2024
1 parent e95daa9 commit c454a03
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion packages/turf-clean-coords/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "turf clean-coords module",
"author": "Turf Authors",
"contributors": [
"Stefano Borghi <@stebogit>"
"Stefano Borghi <@stebogit>",
"James Beard <@smallsaucepan>"
],
"license": "MIT",
"bugs": {
Expand Down
20 changes: 11 additions & 9 deletions packages/turf-clean-coords/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ test("turf-clean-coords -- prevent input mutation", (t) => {
t.end();
});

test("turf-clean-coords -- issue 2305", (t) => {
test("turf-clean-coords - north south lines - issue 2305", (t) => {
// From https://github.com/Turfjs/turf/issues/2305#issue-1287442870
t.deepEqual(
cleanCoords(
Expand All @@ -170,7 +170,8 @@ test("turf-clean-coords -- issue 2305", (t) => {
[0, 0],
[0, 1],
[0, 0],
])
]),
"northern turnaround point is kept"
);

// From https://github.com/Turfjs/turf/issues/2305#issue-1287442870
Expand All @@ -188,13 +189,14 @@ test("turf-clean-coords -- issue 2305", (t) => {
[0, 0],
[0, 2],
[0, 0],
])
]),
"northern turnaround point is kept"
);

t.end();
});

test("turf-clean-coords -- issue 2740", (t) => {
test("turf-clean-coords - overly aggressive removal - issue 2740", (t) => {
// Issue 2740 is cleanCoords was too aggresive at removing points.
t.deepEqual(
cleanCoords(
Expand All @@ -209,7 +211,7 @@ test("turf-clean-coords -- issue 2740", (t) => {
[0, 2],
[0, 0],
]),
"#2740 north-south retraced line"
"north-south retraced line turnaround point kept"
);

t.deepEqual(
Expand All @@ -227,7 +229,7 @@ test("turf-clean-coords -- issue 2740", (t) => {
[0, 3],
[0, 0],
]),
"#2740 north-south retraced line extra points"
"north-south retraced line properly cleaned"
);

t.deepEqual(
Expand All @@ -247,13 +249,13 @@ test("turf-clean-coords -- issue 2740", (t) => {
[0, -2],
[0, 0],
]),
"#2740 north-south retraced past origin and back to start"
"north-south retraced past origin and back to start line properly cleaned"
);

t.end();
});

test("turf-clean-coords -- issue 2406", (t) => {
test("turf-clean-coords - start point protected - issue 2406", (t) => {
t.true(
booleanEqual(
cleanCoords(
Expand All @@ -279,7 +281,7 @@ test("turf-clean-coords -- issue 2406", (t) => {
],
])
),
"#2406 polygon start point (a) should also be removed"
"polygon start point (a) was also removed"
);

t.end();
Expand Down

0 comments on commit c454a03

Please sign in to comment.