Skip to content

Gen testcalls

Functions

[get_exported_functions]{#get_exported_functions data-4search="ui/gen-testcalls.ts:get_exported_functions;func"} (file_path) : Extract exported function names from TypeScript source using regex. For Makefile generation, this needs to work without any node_modules.

DESIGN PRINCIPLE: Never silently skip potential test functions (no false negatives).
Better to throw an error than miss a test, test export code can easily be adapted.

SUPPORTED PATTERNS (detected as tests):
- export function name() {} (including async, generator)
- export const/let/var name = ... (arrow functions, values, function expressions)
- export default function name() {}
- export { foo, bar as baz }

SKIPPED SILENTLY (TypeScript-only, never runtime):
- export interface/type/class/enum

THROWS ERROR (patterns that need explicit handling - rewrite or skip):
- export default () => {} (arrow function default) - rewrite as named function
- export namespace NS { ... }
- export declare function foo() {}
- export import Foo = require("foo")
- Any unrecognized export pattern