test: add unit and integration test suite
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
This commit is contained in:
@@ -15,7 +15,10 @@
|
||||
"scripts": {
|
||||
"lsp": "tsx ./cli.ts",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "oxlint . --ignore-pattern=.direnv/**"
|
||||
"lint": "oxlint . --ignore-pattern=.direnv/**",
|
||||
"test": "NODE_OPTIONS='--import=tsx' node --test test/unit/**/*.ts test/integration/**/*.ts",
|
||||
"test:unit": "NODE_OPTIONS='--import=tsx' node --test test/unit/**/*.ts",
|
||||
"test:integration": "NODE_OPTIONS='--import=tsx' node --test test/integration/**/*.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-jsonrpc": "^8.2.1",
|
||||
|
||||
Reference in New Issue
Block a user