e4dcfc49aa
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
17 lines
504 B
TypeScript
17 lines
504 B
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import { firstParam } from "../lib/route-params";
|
|
|
|
test("firstParam returns undefined for missing param", () => {
|
|
assert.equal(firstParam(undefined), undefined);
|
|
});
|
|
|
|
test("firstParam returns scalar param unchanged", () => {
|
|
assert.equal(firstParam("ielts-tutor"), "ielts-tutor");
|
|
});
|
|
|
|
test("firstParam returns first element for catch-all array", () => {
|
|
assert.equal(firstParam(["ielts-tutor", "extra"]), "ielts-tutor");
|
|
});
|