Add 34 tests (27 unit, 7 integration) using node:test runner: Unit tests: - pickServer(), findRoot(), pathToUri(), uriToPath() - isLspCommand(), listCommands() - formatHover(), formatDefinition(), formatReferences(), formatDiagnostics() Integration tests: - daemon lifecycle (status/stop) on isolated socket - CLI --no-daemon queries (hover, documentSymbol, diagnostics) Supporting changes: - socketPath() honors PI_LSP_SOCKET_PATH env var for test isolation - test fixtures for valid and broken TypeScript files - npm test / test:unit / test:integration scripts
13 lines
433 B
TypeScript
13 lines
433 B
TypeScript
// Broken Fixture — Intentional type errors for diagnostics testing.
|
|
|
|
/** This variable has a type mismatch — string assigned to number. */
|
|
export const brokenNumber: number = "not a number";
|
|
|
|
/** This function returns wrong type — string instead of boolean. */
|
|
export function brokenBoolean(): boolean {
|
|
return "yes";
|
|
}
|
|
|
|
/** This variable uses an undefined identifier. */
|
|
export const brokenReference = definitelyUndefined;
|