Skip to content

Commit

Permalink
fix(cli): the first item is executed as the last one (#8205)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihexxa authored Nov 27, 2024
1 parent df1e8d9 commit 922567b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/insomnia-inso/src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ describe('inso dev bundle', () => {

expect(firstReqLogPosition).toBeGreaterThanOrEqual(0);
expect(secondReqLogPosition).toBeGreaterThanOrEqual(0);
expect(firstReqLogPosition < secondReqLogPosition).toBeTruthy;

expect(secondReqLogPosition).toBeGreaterThan(firstReqLogPosition);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia-inso/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export const go = (args?: string[]) => {
// sort requests
if (options.item.length) {
const requestOrder = new Map<string, number>();
options.item.forEach((reqId: string, order: number) => requestOrder.set(reqId, order));
options.item.forEach((reqId: string, order: number) => requestOrder.set(reqId, order + 1));
requestsToRun = requestsToRun.sort((a, b) => (requestOrder.get(a._id) || requestsToRun.length) - (requestOrder.get(b._id) || requestsToRun.length));
}

Expand Down

0 comments on commit 922567b

Please sign in to comment.