Skip to content

Commit

Permalink
alias test now correctly cleanup the generated aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
gturi committed Feb 23, 2024
1 parent 54707b5 commit 684accb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/utils/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function createAliasAndVerifyOutput(aliasName: string, ...args: string[])
console.error(error);
throw error;
} finally {
cleanup(true);
cleanup(aliasName);
}
}

Expand All @@ -64,9 +64,9 @@ function setup() {
process.env.ncaMainConfigFilePath = ncaMainConfigFilePath;
}

function cleanup(cleanLocalAliases: boolean = false) {
if (cleanLocalAliases) {
NodeUtils.unlinkLocalAliases();
function cleanup(aliasName: string | null = null) {
if (aliasName) {
runCommandSync('nca', 'alias', 'delete', aliasName);
}
NodeUtils.unlink('node-command-alias');

Expand Down

0 comments on commit 684accb

Please sign in to comment.