Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
Merged
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
6 changes: 6 additions & 0 deletions src/plugins/deploy/azureDeployPlugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,10 @@ describe("Deploy plugin", () => {
expect(ResourceService.prototype.listDeployments).toBeCalled();
expect(sls.cli.log).lastCalledWith(deploymentString);
});

it("crashes deploy if zip file is not found", async () => {
FunctionAppService.prototype.getFunctionZipFile = jest.fn(() => "notExisting.zip");
await expect(invokeHook(plugin, "deploy:deploy"))
.rejects.toThrow(/Function app zip file '.*' does not exist/)
});
});
3 changes: 1 addition & 2 deletions src/plugins/deploy/azureDeployPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ export class AzureDeployPlugin extends AzureBasePlugin<AzureLoginOptions> {
const functionAppService = new FunctionAppService(this.serverless, this.options);
const zipFile = functionAppService.getFunctionZipFile();
if (!fs.existsSync(zipFile)) {
this.log(`Function app zip file '${zipFile}' does not exist`);
return Promise.resolve();
throw new Error(`Function app zip file '${zipFile}' does not exist`);
}
await resourceService.deployResourceGroup();
const functionApp = await functionAppService.deploy();
Expand Down