Skip to content

Commit

Permalink
Update mock naming so tests pass in frodo-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
phalestrivir committed May 7, 2024
1 parent 54d3bb3 commit c00b4eb
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/utils/SetupPollyForFrodoLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,32 @@ function getFrodoCommand({ state }: { state: State }) {
'/' +
getFrodoArgsId({ start: 2, state });
} else {
cmd = process.argv[2] + '/' + getFrodoArgsId({ start: 3, state });
cmd = process.argv[2] + '/';
let i = 3;
if (cmd === 'info/') {
cmd += getFrodoArgsId({ start: 3, state });
} else {
if (
process.argv[i] === 'export' ||
process.argv[i] === 'import' ||
process.argv[i] === 'list' ||
process.argv[i] === 'delete' ||
process.argv[i] === 'count' ||
process.argv[i] === 'describe' ||
process.argv[i] === 'enable' ||
process.argv[i] === 'disable'
) {
cmd += process.argv[i++] + '/';
}
let firstParamIndex = process.argv.findIndex((a) => a.startsWith('-'));
firstParamIndex =
firstParamIndex === -1 ? process.argv.length : firstParamIndex;
cmd += process.argv.slice(i, firstParamIndex).join('-');
if (!cmd.endsWith('/')) {
cmd += '/';
}
cmd += getFrodoArgsId({ start: firstParamIndex, state });
}
}
} catch (error) {
printMessage({
Expand Down

0 comments on commit c00b4eb

Please sign in to comment.