Skip to content

Commit

Permalink
disable spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
niclim committed Sep 26, 2023
1 parent 091632f commit 35897bc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
17 changes: 12 additions & 5 deletions projects/optic/src/commands/capture/actions/captureRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@ function makeAllRequests(
export async function captureRequestsFromProxy(
config: OpticCliConfig,
captureConfig: CaptureConfigData,
options: { proxyPort?: string; serverOverride?: string; serverUrl: string }
options: {
proxyPort?: string;
serverOverride?: string;
serverUrl: string;
disableSpinner?: boolean;
}
) {
let app: ChildProcessWithoutNullStreams | undefined = undefined;
let proxy: ProxyServer | undefined = undefined;
Expand All @@ -307,10 +312,12 @@ export async function captureRequestsFromProxy(
const unsubscribeHook = exitHook(() => {
cleanup();
});
const spinner = getSpinner({
text: 'Generating traffic to send to server',
color: 'blue',
})?.start();
const spinner = options.disableSpinner
? undefined
: getSpinner({
text: 'Generating traffic to send to server',
color: 'blue',
})?.start();
let interactions: ProxyInteractions | null = null;

const serverUrl = options.serverUrl;
Expand Down
16 changes: 8 additions & 8 deletions projects/optic/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,17 @@ function report(report: SpecReport) {
if (report.changelogLink) {
logger.info(`| View report: ${report.changelogLink}`);
}
logger.info('|');
if (report.capture) {
const { bufferedOutput, coverage, unmatchedInteractions } = report.capture;
logger.info(
`| ${coverage}% API test coverage ${
unmatchedInteractions
? `(${unmatchedInteractions} unmatched interactions)`
: ''
}`
);
const { bufferedOutput, coverage } = report.capture;
logger.info(`| API Test Coverage Report (${coverage}% coverage)`);
bufferedOutput.forEach((output) => {
logger.info(`| ` + output);
});
} else {
logger.info(
`| Skipping API test verification (set up by running optic capture init ${report.path})`
);
}
logger.info('');
}
Expand Down Expand Up @@ -535,6 +534,7 @@ export const getRunAction =
captureConfig,
{
serverUrl: captureConfig.server.url,
disableSpinner: true,
}
);
if (!harEntries) {
Expand Down

0 comments on commit 35897bc

Please sign in to comment.