Configuration types and the legacy configuration helper for the Proby test runner.
The proby command discovers and runs *.spec.ts and *.spec.js files on
Node, Deno, and Bun. New configuration files should use
test.config() from @rcompat/test; the default
export remains available for existing proby.config.* files.
import config from "proby";
import type { Config, TestConfig } from "proby";config() legacy helper#
Returns a type-checked test configuration unchanged.
This helper is retained for existing proby.config.* files. New
spec.config.* files should use
test.config() from @rcompat/test.
Parameters
input— Test discovery and preload options.
Returns: The original configuration object.
config<T extends TestConfig>(input: Exact<T>): T;Example
import config from "proby";
export default config({
include: ["src"],
monorepo: true,
});Types#
Config#
Fully normalized configuration used by the Proby runner.
type Config = {
// Whether package directories are scanned as a monorepo.
monorepo: boolean;
// Package directory resolved from the project root.
packages: string;
// Directories searched for spec files.
include: string[];
// Modules preloaded before test files run.
loaders: string[];
};TestConfig#
Test-runner configuration accepted by test.config.
interface TestConfig {
// Directories searched for spec files.
// Default: `["src", "test"]`
include?: readonly string[];
// Modules preloaded before test files run.
// Default: `[]`
loaders?: readonly string[];
// Whether package directories are scanned as a monorepo.
// Default: `false`
monorepo?: boolean;
// Package directory resolved from the project root.
// Default: `"packages"`
packages?: string;
}Supporting contracts#
Exact#
Rejects configuration keys outside the public input contract.
type Exact<T extends TestConfig> = T & Record<
Exclude<keyof T, keyof TestConfig>, never
>;