From 16e2eb05ebf29b5c29192e016646e57facea310f Mon Sep 17 00:00:00 2001 From: plamen5kov Date: Tue, 7 Feb 2017 13:23:17 +0200 Subject: [PATCH 1/2] don't add platform after tns platform clean is ran --- lib/commands/platform-clean.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/commands/platform-clean.ts b/lib/commands/platform-clean.ts index 32eb477c9c..db74e363b1 100644 --- a/lib/commands/platform-clean.ts +++ b/lib/commands/platform-clean.ts @@ -6,7 +6,6 @@ export class CleanCommand implements ICommand { public async execute(args: string[]): Promise { this.$platformService.removePlatforms(args); - await this.$platformService.addPlatforms(args); } public async canExecute(args: string[]): Promise { From 017a9cf03f709080908d35a8abe61f142994f280 Mon Sep 17 00:00:00 2001 From: plamen5kov Date: Wed, 8 Feb 2017 14:45:56 +0200 Subject: [PATCH 2/2] updated test after refactor --- test/platform-commands.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/platform-commands.ts b/test/platform-commands.ts index 2a77198ef9..86d54d4217 100644 --- a/test/platform-commands.ts +++ b/test/platform-commands.ts @@ -399,7 +399,7 @@ describe('Platform Service Tests', () => { assert.isFalse(isCommandExecuted); }); - it("will call removePlatform and addPlatform on the platformService passing the provided platforms", async () => { + it("will call removePlatform on the platformService passing the provided platforms", async () => { let platformActions: { action: string, platforms: string[] }[] = []; testInjector.registerCommand("platform|clean", CleanCommand); let cleanCommand = testInjector.resolveCommand("platform|clean"); @@ -408,17 +408,10 @@ describe('Platform Service Tests', () => { platformActions.push({ action: "removePlatforms", platforms }); }; - platformService.addPlatforms = async (platforms: string[]) => { - - platformActions.push({ action: "addPlatforms", platforms }); - - }; - await cleanCommand.execute(["ios"]); let expectedPlatformActions = [ { action: "removePlatforms", platforms: ["ios"] }, - { action: "addPlatforms", platforms: ["ios"] }, ]; assert.deepEqual(platformActions, expectedPlatformActions, "Expected `remove ios`, `add ios` calls to the platformService.");