Skip to content

Commit

Permalink
Optic capture in run (#2349)
Browse files Browse the repository at this point in the history
  • Loading branch information
niclim authored Sep 26, 2023
1 parent 9889685 commit 454c306
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 176 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,7 @@ GET /books
...and 1 endpoint that did not receive traffic
5 unmatched requests
New endpoints are only added in interactive mode. Run 'optic capture openapi.yml --update interactive' to add new endpoints
"
`;
Expand Down
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
Loading

0 comments on commit 454c306

Please sign in to comment.