From 684accb0faccf1a284a6e82b57a482d11cde7fda Mon Sep 17 00:00:00 2001 From: gventurini Date: Fri, 23 Feb 2024 18:15:23 +0100 Subject: [PATCH] alias test now correctly cleanup the generated aliases --- test/utils/test-utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/utils/test-utils.ts b/test/utils/test-utils.ts index c393def2..a30f65cf 100644 --- a/test/utils/test-utils.ts +++ b/test/utils/test-utils.ts @@ -52,7 +52,7 @@ export function createAliasAndVerifyOutput(aliasName: string, ...args: string[]) console.error(error); throw error; } finally { - cleanup(true); + cleanup(aliasName); } } @@ -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');