Skip to content

Commit

Permalink
fix(seed): Change schema so tests pass
Browse files Browse the repository at this point in the history
This is just a quick fix for the issue with the schema differences
between curriculum and the main fCC repo brought up in
freeCodeCamp/curriculum#204. The changes to
the schema here bring it in line with the more recently changed schema
in curriculum, and `npm run test` pass with the curriculum NPM package
3.1.2.
  • Loading branch information
scissorsneedfoodtoo committed Sep 19, 2018
1 parent 2f31140 commit d1ae6fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion seed/schema/challengeSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const schema = Joi.object().keys({
isRequired: Joi.bool(),
name: Joi.string(),
order: Joi.number().options({ convert: false }),
releasedOn: Joi.string().allow(''),
required: Joi.array().items(
Joi.object().keys({
link: Joi.string(),
Expand Down Expand Up @@ -69,7 +70,14 @@ const schema = Joi.object().keys({
),
template: Joi.string(),
time: Joi.string().allow(''),
title: Joi.string().required()
title: Joi.string().required(),
translations: Joi.object().pattern(
/\w+(-\w+)*/,
Joi.object().keys({
title: Joi.string(),
description: Joi.array().items(Joi.string().allow(''))
})
)
});

exports.validateChallenge = function validateChallenge(challenge) {
Expand Down

0 comments on commit d1ae6fc

Please sign in to comment.