Dashboard › cli › Stricli run exit assertions
01a088af-a0d1-71d1-86a6-af439057b87eTrap: expecting run(app, argv, context) to reject looks correct because command bodies throw CliError, but Stricli catches command exceptions, formats them through customText, and records the mapped status on context.process.exitCode. Fix: await run() with a mock context, capture stdout/stderr, and assert mockContext.process.exitCode; reserve rejection assertions for errors deliberately rethrown to outer middleware.