Skip to content

don't add platform after tns platform clean is ran #2502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/commands/platform-clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export class CleanCommand implements ICommand {

public async execute(args: string[]): Promise<void> {
this.$platformService.removePlatforms(args);
await this.$platformService.addPlatforms(args);
}

public async canExecute(args: string[]): Promise<boolean> {
Expand Down
9 changes: 1 addition & 8 deletions test/platform-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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.");
Expand Down