Skip to content

Commit

Permalink
PR feedback pt3
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecote committed Jun 17, 2019
1 parent 39187c0 commit f11a6ae
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,25 @@ test('should validate and throw error when actionTypeConfig is invalid', () => {
`"actionTypeConfig invalid: child \\"param1\\" fails because [\\"param1\\" is required]"`
);
});

test('should not return values when actionTypeConfig is invalid', () => {
expect(() =>
validateActionTypeConfig(
{
id: 'my-action-type',
name: 'My action type',
validate: {
config: Joi.object()
.keys({
param1: Joi.number().required(),
})
.required(),
},
async executor() {},
},
{ param1: 'my secret value' }
)
).toThrowErrorMatchingInlineSnapshot(
`"actionTypeConfig invalid: child \\"param1\\" fails because [\\"param1\\" must be a number]"`
);
});

0 comments on commit f11a6ae

Please sign in to comment.