Skip to content

Commit

Permalink
Solve issues with tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Feb 14, 2025
1 parent 43f7746 commit 6856ac0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"postinstall": "node -e \"require('fs').existsSync('githooks') && require('./githooks/configure.js').configure()\"",
"buildDebug": "npm run format && npm run fix && tsc --sourceMap true",
"build": "npm run format && npm run fix && tsc",
"format": "prettier --write .",
"format": "prettier --loglevel warn --write .",
"lint": "eslint . --max-warnings=0 --ignore-pattern dist",
"fix": "eslint . --max-warnings=0 --ignore-pattern dist --fix",
"start": "node dist/index.js"
Expand Down
17 changes: 15 additions & 2 deletions src/cli/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@ const parseOptions: ParseOptions<CLIArgs> = {
partial: true
};

const args = parse<CLIArgs>(optionsDefinition, parseOptions);
const args = ((): CLIArgs & { _unknown: Array<string> } => {
const parsedArgs = parse<CLIArgs>(optionsDefinition, parseOptions);

export default { _unknown: [], ...args };
// Adding this here because the CLI integration tests execute API
// methods either from the child process (runCLI) to the parent
// process, the one running mocha, so if we just add --dev in the child
// it fails on the parent process, this is is also fine here because it
// is executed only once at the startup of the program
if (process.env.TEST_DEPLOY_LOCAL === 'true') {
parsedArgs.dev = true;
}

return { _unknown: [], ...parsedArgs };
})();

export default args;

0 comments on commit 6856ac0

Please sign in to comment.