What problem does this solve?
packages/core/src/history/CommandHistory.ts has no test file.
CommandHistory manages shell-style command history with navigation,
search, import/export, and size limits. None of this logic is currently
covered by tests, meaning regressions would go undetected.
Proposed solution
Create packages/core/src/history/CommandHistory.test.ts covering:
- add() ignores empty/whitespace-only commands
- add() stores valid commands in order
- add() evicts oldest command when maxSize is exceeded
- previous() navigates backward through history
- previous() clamps at first command
- previous() returns null when history is empty
- next() navigates forward through history
- next() returns null when past the last command
- search() filters commands case-insensitively
- getAll() returns a copy of all commands
- clear() empties history and resets index
- export() serializes history to JSON string
- import() restores history from JSON string
Which package would this belong in?
@termuijs/core — packages/core/src/history/CommandHistory.test.ts
GSSoC contributor?
What problem does this solve?
packages/core/src/history/CommandHistory.ts has no test file.
CommandHistory manages shell-style command history with navigation,
search, import/export, and size limits. None of this logic is currently
covered by tests, meaning regressions would go undetected.
Proposed solution
Create packages/core/src/history/CommandHistory.test.ts covering:
Which package would this belong in?
@termuijs/core — packages/core/src/history/CommandHistory.test.ts
GSSoC contributor?