diff --git a/test/extension/commands/setNewArch.test.ts b/test/extension/commands/setNewArch.test.ts index 19f1e6773..a4b754830 100644 --- a/test/extension/commands/setNewArch.test.ts +++ b/test/extension/commands/setNewArch.test.ts @@ -215,4 +215,18 @@ suite("setNewArchCommand", function () { assert.strictEqual(writeFileStub.called, false); assert.strictEqual(spawnStub.called, false); }); + + test("should return without writing when new architecture selection is cancelled", async function () { + const showQuickPickStub = Sinon.stub(); + showQuickPickStub.onFirstCall().returns(Promise.resolve("Android")); + showQuickPickStub.onSecondCall().returns(Promise.resolve(undefined)); + const writeFileStub = Sinon.stub().returns(Promise.resolve()); + const spawnStub = Sinon.stub().returns(Promise.resolve()); + const { SetNewArch } = createCommandModule(showQuickPickStub, writeFileStub, spawnStub); + + await runCommand(SetNewArch); + + assert.strictEqual(writeFileStub.called, false); + assert.strictEqual(spawnStub.called, false); + }); });