The builder types are already the inferred return types and travel into the emitted .d.ts, so exporting them only made them nameable while pinning the internal Strict/Widening split as API. Revert the type exports and the public renames, drop the type-surface test, and document only the factories in README and development/library.md.
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
import { strict as assert } from "node:assert";
|
|
import { test } from "node:test";
|
|
|
|
import { expectTypeOf } from "expect-type";
|
|
|
|
import {
|
|
getPrimitiveUnionMatcher,
|
|
getPrimitiveUnionMatcherW,
|
|
getTaggedUnionMatcher,
|
|
getTaggedUnionMatcherW,
|
|
} from "./index.ts";
|
|
|
|
// The published entry point is the barrel (`package.json` exports
|
|
// `./dist/index.js`), so every factory must be reachable from here. Importing it
|
|
// also loads the module, which is what lets c8's `--all` measure it — see
|
|
// development/ci.md § Coverage threshold.
|
|
test("index: the public entry point re-exports every matcher factory", () => {
|
|
// Assert
|
|
expectTypeOf(getPrimitiveUnionMatcher).toBeFunction();
|
|
assert.equal(typeof getPrimitiveUnionMatcher, "function");
|
|
expectTypeOf(getPrimitiveUnionMatcherW).toBeFunction();
|
|
assert.equal(typeof getPrimitiveUnionMatcherW, "function");
|
|
expectTypeOf(getTaggedUnionMatcher).toBeFunction();
|
|
assert.equal(typeof getTaggedUnionMatcher, "function");
|
|
expectTypeOf(getTaggedUnionMatcherW).toBeFunction();
|
|
assert.equal(typeof getTaggedUnionMatcherW, "function");
|
|
});
|