Add integration tests #27

Merged
joeybaker merged 6 commits from add-integration-tests into master 2016-10-26 21:08:38 +00:00
Showing only changes of commit 90f72cb07a - Show all commits

View File

@ -63,14 +63,17 @@ export default (server, model, { prefix, defaultConfig: config, models: permissi
const { _singular, _plural, _Singular, _Plural } = target;
return [_singular, _plural, _Singular, _Plural];
}),
];
].filter(Boolean);
const attributeValidation = modelAttributes.reduce((params, attribute) => {
// TODO: use joi-sequelize
params[attribute] = joi.any();
return params;
}, {});
const validAssociations = joi.string().valid(...modelAssociations);
const validAssociations = modelAssociations.length
? joi.string().valid(...modelAssociations)
: joi.valid(null);
const associationValidation = {
include: [joi.array().items(validAssociations), validAssociations],
};