Skip to content

Commit 4f97c0f

Browse files
authored
Merge pull request #13 from rschick/test-coverage
Add test for uncovered branch
2 parents 3484232 + 92fe562 commit 4f97c0f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

test/add-permissions-tests.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function createTestInstance(options) {
1313
log: () => {}
1414
},
1515
service: {
16-
provider: options.provider || {},
16+
provider: options.provider,
1717
functions: options.functions,
1818
resources: options.resources ? { Resources: options.resources } : undefined
1919
},
@@ -73,8 +73,23 @@ describe('serverless-plugin-lambda-account-access', function() {
7373
.that.is.undefined;
7474
});
7575

76+
it('should not add resources when provider config is not set', function() {
77+
const instance = createTestInstance({
78+
functions: {
79+
function1: {}
80+
}
81+
});
82+
83+
instance.beforeDeploy();
84+
85+
expect(instance)
86+
.to.have.nested.property('serverless.service.resources')
87+
.that.is.undefined;
88+
});
89+
7690
it('should not add resources when access config is not set', function() {
7791
const instance = createTestInstance({
92+
provider: {},
7893
functions: {
7994
function1: {}
8095
}

0 commit comments

Comments
 (0)