Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setNextRequest alternative implementation #8132

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add logs
jackkav committed Oct 26, 2024
commit eb826ff48e35e15a6d0b85bbd9ccbe51aeda4c98
3 changes: 3 additions & 0 deletions packages/insomnia-inso/src/cli.ts
Original file line number Diff line number Diff line change
@@ -565,10 +565,13 @@ export const go = (args?: string[]) => {
}
// TODO: add support for skipRequest
if (res.nextRequestIdOrName) {
logger.trace(`setNextRequest(${res.nextRequestIdOrName}) found, adding to workflow queue, and removing any others`);

// TODO: add support for null input to exit 0
const nextRequest = requestsToRun.find(r => r.name === res.nextRequestIdOrName || r._id === res.nextRequestIdOrName);
if (nextRequest) {
workflowQueue = [];
// TODO: should we use the same iteration data as previous or next in list?
workflowQueue.push({ req: nextRequest, iteration: current.iteration, iterationData: current.iterationData });
}
}

Unchanged files with check annotations Beta

if (result.code !== 0) {
console.log(result);
}
expect(result.code).toBe(0);

Check failure on line 72 in packages/insomnia-inso/src/cli.test.ts

GitHub Actions / Test

src/cli.test.ts > inso dev bundle > exit codes are consistent > exit code should be 0: %p $PWD/packages/insomnia-inso/bin/inso run collection -w packages/insomnia-inso/src/examples/set-next-request.yml wrk_cbc89e

AssertionError: expected 1 to be +0 // Object.is equality - Expected + Received - 0 + 1 ❯ src/cli.test.ts:72:27
});
it.each(shouldReturnErrorCode)('exit code should be 1: %p', async input => {
const result = await runCliFromRoot(input);