Skip to content

Commit

Permalink
feat: set empty branch to skip creating a Branch resource
Browse files Browse the repository at this point in the history
  • Loading branch information
brettstack committed May 1, 2020
1 parent b0c336f commit 98a7832
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,16 @@ frontend:
serverlessAmplifyPluginInstance.hooks['before:package:finalize']()
expect(serverless.service.provider.compiledCloudFormationTemplate.Resources.MyServiceAmplifyApp.Properties.AccessToken).toStrictEqual(serverless.service.custom.amplify.accessToken)
})
it('doesn\'t create an AWS::Amplify::Branch resource if branch is empty', () => {
const amplifyConfig = {
branch: ''
}
const serverless = makeMockServerless({
amplify: amplifyConfig
})

const serverlessAmplifyPluginInstance = new ServerlessAmplifyPlugin(serverless)
serverlessAmplifyPluginInstance.hooks['before:package:finalize']()
expect(serverless.service.provider.compiledCloudFormationTemplate.Resources.MyServiceAmplifyBranch).toBeUndefined()
})
})

0 comments on commit 98a7832

Please sign in to comment.