Reference · Parsing, formatting and shared types
TestCaseBasetype
The fields every case in the package's JSON test files has: a name or description, the input, what is expected and the options. Exported for tools that read those files.
Import it
import type { TestCaseBase } from "@johnmorrisdotca/address-plus";
Definition
interface TestCaseBase {
name?: string;
description?: string;
input: unknown;
expected: unknown;
options?: Record<string, unknown>;
}
Members
| Name | Type | Description |
|---|---|---|
name (optional) | string | undefined | |
description (optional) | string | undefined | |
input | unknown | |
expected | unknown | |
options (optional) | Record<string, unknown> | undefined |
Examples
import type { TestCaseBase } from "@johnmorrisdotca/address-plus";
console.log(({ name: "a ZIP code", input: "98101", expected: "WA" }).expected);
// → "WA"WAWhat it prints (run when this page was built)