You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.0 KiB
TypeScript

import { describe, it, expect } from "vitest";
import { toGetClosestPoint } from "./toGetClosestPoint.ts";
describe("toGetClosestPoint", () => {
it("-1, -2, 5, 3, -4, 6 equale NW", () => {
expect(toGetClosestPoint(-1, -2, 5, 3, -4, 6)).toBe("NW");
});
it("-1, -2, 5, 3, 4, 5 equale N", () => {
expect(toGetClosestPoint(-1, -2, 5, 3, 4, 5)).toBe("N");
});
it("-1, -2, 5, 3, 9, 3 equale NE", () => {
expect(toGetClosestPoint(-1, -2, 5, 3, 9, 3)).toBe("NE");
});
it("-1, -2, 5, 3, 7, 0 equale E", () => {
expect(toGetClosestPoint(-1, -2, 5, 3, 7, 0)).toBe("E");
});
it("-1, -2, 5, 3, 8, -4 equale SE", () => {
expect(toGetClosestPoint(-1, -2, 5, 3, 8, -4)).toBe("SE");
});
it("-1, -2, 5, 3, 2, -4 equale S", () => {
expect(toGetClosestPoint(-1, -2, 5, 3, 2, -4)).toBe("S");
});
it("-1, -2, 5, 3, -5, -2 equale SW", () => {
expect(toGetClosestPoint(-1, -2, 5, 3, -5, -2)).toBe("SW");
});
it("-1, -2, 5, 3, -5, 2 equale W", () => {
expect(toGetClosestPoint(-1, -2, 5, 3, -5, 2)).toBe("W");
});
});