Files
dsa/src/codewars/white-or-black/main.spec.ts
T
naomi 1f44f2ddd9
Node.js CI / Lint and Test (push) Successful in 37s
feat: initial repo scaffolding
Port in some older solutions I've written just to
get the structure established and in place.
2025-11-19 15:35:26 -08:00

24 lines
577 B
TypeScript

/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { describe, it, expect } from "vitest";
import { mineColor } from "./main.js";
describe("mineColor", () => {
it("should return white if the square is white", () => {
expect(mineColor("a", 8)).toBe("white");
expect(mineColor("f", 5)).toBe("white");
});
it("should return black if the square is black", () => {
expect(mineColor("b", 2)).toBe("black");
});
it("should handle empty strings", () => {
expect(mineColor("", 1)).toBe("white");
});
});