diff --git a/src/Reporter.tsx b/src/Reporter.tsx index df93daf..cab4896 100644 --- a/src/Reporter.tsx +++ b/src/Reporter.tsx @@ -89,35 +89,43 @@ const FailureMessage: React.FC<{ const CompletedTests: React.FC<{ completedTests: State['completedTests']; globalConfig: Config.GlobalConfig; -}> = ({ completedTests, globalConfig }) => { + summary: React.ReactElement; + PostMessage: () => React.ReactElement; + done: boolean; +}> = ({ completedTests, globalConfig, summary, PostMessage, done }) => { if (completedTests.length === 0) { return null; } const didUpdate = globalConfig.updateSnapshot === 'all'; + let testOutputs = completedTests.map(({ testResult, config }) => ( + + + + + + + + )); + + if (done) { + testOutputs = testOutputs.concat( + + {summary} + , + + + , + ); + } + return ( - - {({ testResult, config }) => ( - - - - - - - - )} - + {ele => ele} ); }; @@ -242,29 +250,34 @@ const Reporter: React.FC = ({ const { exit } = useApp(); React.useEffect(() => { if (done) { - exit(); + setImmediate(exit); } }, [done, exit]); + const summary = ( + + ); return ( - - ( + + )} /> - {done ? ( - - ) : null} + + {done ? null : summary} ); };