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
Next Next commit
fix test results bug
jackkav committed Oct 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit dfcd652ea01240c161f80fe4dcf7a610a16669ad
5 changes: 3 additions & 2 deletions packages/insomnia/src/common/send-request.ts
Original file line number Diff line number Diff line change
@@ -166,7 +166,8 @@ export async function getSendRequestCallbackMemDb(environmentId: string, memDB:
const headers = headerArray?.reduce((acc, { name, value }) => ({ ...acc, [name.toLowerCase() || '']: value || '' }), []);
const bodyBuffer = await getBodyBuffer(res) as Buffer;
const data = bodyBuffer ? bodyBuffer.toString('utf8') : undefined;

return { status, statusMessage, data, headers, responseTime, timelinePath: requestData.timelinePath, testResults: postMutatedContext.requestTestResults, nextRequestIdOrName: postMutatedContext?.execution?.nextRequestIdOrName };
// TODO: find out why requestTestResults can be undefined and eliminate the case so its always an array
const testResults = [...(mutatedContext.requestTestResults || []), ...(postMutatedContext.requestTestResults || [])];
return { status, statusMessage, data, headers, responseTime, timelinePath: requestData.timelinePath, testResults, nextRequestIdOrName: postMutatedContext?.execution?.nextRequestIdOrName };
};
}

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);