test/isEven.test.js
zzmq.dev@gmail.com/mathkit / test / isEven.test.js
@ 9271926f
Download
Ladder Summary
- file Contains unit tests to verify the functionality of the isEven function, testing positive numbers, negative numbers, and zero.
import { test } from "node:test";
import assert from "node:assert/strict";
import { isEven } from "../src/isEven.js";
test("isEven with positive numbers", () => {
assert.strictEqual(isEven(1), false);
assert.strictEqual(isEven(2), true);
});
test("isEven with negative numbers", () => {
assert.strictEqual(isEven(-1), false);
assert.strictEqual(isEven(-2), true);
});
test("isEven with zero", () => {
assert.strictEqual(isEven(0), true);
});