Open
Conversation
- Replace jest with vitest 4.1.5 + @vitest/coverage-v8 - Add vitest.config.ts with v8 coverage provider and 95% thresholds - Update package.json scripts: test, test:coverage - Migrate jest.fn/mock/spyOn to vi equivalents in test files - Refactor lib/ipsafe.js to use childProcess namespace (vi.spyOn-friendly) - Update eslint config to expose vi global in tests
Final coverage: stmts 99.61%, branches 98.11%, funcs 100%, lines 99.59%. - Add platform-specific config path tests (Windows AppData, XDG_CONFIG_HOME). - Add edge case tests for loadConfig, initGlobalConfig, testConnectivity defaults (port, method, headers), executeCommand signal/timeout cleanup, parseCommand quote handling, checkContent uppercase regex. - Cover all interactive command names (claude, vim, nano, less, more, top, htop) and uppercase variants. - Use cache-busted dynamic import() in cli.test.js so the bin script re-executes per test (vitest 4 removed vi.isolateModulesAsync). - Annotate implicit-else branches with /* v8 ignore else */ since vitest 4's V8 coverage cannot track synthetic else branches for if-without-else statements (reports [hits, 0] with empty location).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate test framework to vitest with 95% coverage thresholds on all four dimensions (statements, branches, functions, lines).