Skip to content
This repository was archived by the owner on Jul 23, 2021. It is now read-only.

Commit dae75a9

Browse files
icj217tchock
authored andcommitted
Re-check custom section to allow file variable resolution (#102)
* Re-checking custom section Re-checking the custom section after variable replacement/resolution is performed * Updated custom variable test Updated test to also delete the `this.serverlessMock.variables.service.custom` value since this is being re-checked in the beforeDeploy() function now.
1 parent e0c8e35 commit dae75a9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class ServerlessAWSDocumentation {
5151
}
5252

5353
beforeDeploy() {
54+
this.customVars = this.serverless.variables.service.custom;
55+
5456
if (!(this.customVars && this.customVars.documentation)) return;
5557

5658
this.cfTemplate = this.serverless.service.provider.compiledCloudFormationTemplate;

src/index.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ describe('ServerlessAWSDocumentation', function () {
8989
});
9090

9191
it('shouldn\'t do anything if there are no custom variables', function () {
92+
delete this.serverlessMock.variables.service.custom;
9293
delete this.plugin.customVars;
9394
this.plugin.beforeDeploy();
9495
expect(this.serverlessMock.service.getAllFunctions).not.toHaveBeenCalled();

0 commit comments

Comments
 (0)