Skip to content

Commit

Permalink
Merge pull request #30 from AntonBazhal/deps3
Browse files Browse the repository at this point in the history
Updated dependencies
  • Loading branch information
AntonBazhal committed May 24, 2017
2 parents 856323d + 596ed59 commit 3bf07f3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"aws-elasticsearch-client": "^1.0.2",
"dynamodb-marshaler": "^2.0.0",
"joi": "^10.4.1",
"joi": "^10.5.0",
"lambda-handler-as-promised": "^1.2.2",
"lodash": "^4.17.4",
"promise-retry": "^1.1.1"
Expand All @@ -46,13 +46,13 @@
"chai-subset": "^1.5.0",
"env-test": "^1.0.0",
"eslint": "^3.19.0",
"eslint-config-airbnb-base": "^11.1.3",
"eslint-plugin-import": "^2.2.0",
"eslint-config-airbnb-base": "^11.2.0",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-mocha": "^4.9.0",
"istanbul": "^0.4.5",
"lambda-tester": "^3.0.2",
"mocha": "^3.3.0",
"sinon": "^2.1.0",
"mocha": "^3.4.2",
"sinon": "^2.3.1",
"uuid": "^3.0.1"
}
}
19 changes: 15 additions & 4 deletions test/handler-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ describe('handler', function() {
'child "typeField" fails because ["typeField" must be a string, "typeField" must be an array]',
'child "pickFields" fails because ["pickFields" must be a string, "pickFields" must be an array]',
'child "versionField" fails because ["versionField" must be a string]',
'child "retryOptions" fails because ["retryOptions" must be an object]',
'"options" must contain at least one of [index, indexField]',
'"options" must contain at least one of [type, typeField]',
'"indexPrefix" missing required peer "indexField"'
'child "retryOptions" fails because ["retryOptions" must be an object]'
]));
});

Expand All @@ -106,6 +103,20 @@ describe('handler', function() {
]));
});

it('should throw when required options are missing', function() {
const testOptions = {
indexPrefix: 'foo'
};

expect(() => lambdaHandler(testOptions))
.to.throw(errors.ValidationError)
.with.property('message', formatErrorMessage([
'"options" must contain at least one of [index, indexField]',
'"options" must contain at least one of [type, typeField]',
'"indexPrefix" missing required peer "indexField"'
]));
});

it('should throw when elasticsearch options are invalid', function() {
const testOptions = {
elasticsearch: {
Expand Down

0 comments on commit 3bf07f3

Please sign in to comment.