Skip to content

v2.0.0

Choose a tag to compare

@nikolainobadi nikolainobadi released this 19 Sep 20:53
· 38 commits to main since this release

NnShellKit 2.0.0 Release Notes

Breaking Changes

  • MockShell: The shouldThrowError initializer parameter has been renamed to shouldThrowErrorOnFinal with different behavior - it now only throws when the results array is exhausted, not for every command.

New Features

  • Timeout Support: NnShell now supports configurable timeouts to prevent commands from hanging indefinitely
  • Enhanced MockShell: New command-specific result mapping using MockCommand for more precise test control
  • CI/CD: Added GitHub Actions workflow for automated testing

Bug Fixes

  • Fixed shell output truncation issue by reading process output asynchronously

Migration Guide

If you're using MockShell with the shouldThrowError parameter:

// Before
let mock = MockShell(results: ["output"], shouldThrowError: true)

// After - for throwing when results exhausted
let mock = MockShell(results: ["output"], shouldThrowErrorOnFinal: true)

// After - for command-specific error handling
let mock = MockShell(commands: [
    MockCommand(command: "failing-cmd", result: .failure(code: 1, output: "error"))
])