Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 97a49e1

Browse files
committed
Add deadLetter as a valid function
We want to upgrade to a newer serverless version, to do that, we need to make this change to work with the new serverless dsl. This was taken from the original repo which is no longer maintained and the proposed fix was not merged. gmetzker#44
1 parent 08784e0 commit 97a49e1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ const BbPromise = require('bluebird');
55
class Plugin {
66

77
constructor(serverless, options) {
8+
serverless.configSchemaHandler.defineFunctionProperties('aws', {
9+
properties: {
10+
deadLetter: { type: 'object' }
11+
}
12+
});
813

914
this.serverless = serverless;
1015
this.options = options;

tests/index.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ describe('serverless-plugin-lambda-dead-letter', () => {
5252

5353
},
5454
cli: { log: () => {
55-
} }
55+
} },
56+
configSchemaHandler: {
57+
defineFunctionProperties: () => {}
58+
}
5659
};
5760

5861
return serverless;
@@ -97,7 +100,8 @@ describe('serverless-plugin-lambda-dead-letter', () => {
97100

98101
// ARRANGE:
99102
const serverlessStub = {
100-
getProvider: sinon.stub()
103+
getProvider: sinon.stub(),
104+
configSchemaHandler: { defineFunctionProperties: () => {} },
101105
};
102106
const provider = { kother: 'v' };
103107
const options = { k: 'v' };

0 commit comments

Comments
 (0)