Skip to content

Commit babcf47

Browse files
a2937huyenltnguyen
andauthored
chore(tools): test for instructions in schema (freeCodeCamp#60323)
Co-authored-by: Huyen Nguyen <[email protected]>
1 parent 8b33e31 commit babcf47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

curriculum/schema/challenge-schema.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ const schema = Joi.object()
209209
}),
210210
forumTopicId: Joi.number(),
211211
id: Joi.objectId().required(),
212-
instructions: Joi.string().allow(''),
212+
instructions: Joi.string().when('challengeType', {
213+
is: [challengeTypes.pythonProject, challengeTypes.codeAllyCert],
214+
then: Joi.string().min(1).required(),
215+
otherwise: Joi.string().allow('')
216+
}),
213217
isComingSoon: Joi.bool(),
214218
isLocked: Joi.bool(),
215219
isPrivate: Joi.bool(),

0 commit comments

Comments
 (0)