feat(curriculum-tests): check that ObjectId filenames match challenge ID (#56138)
parent
36c50c897e
commit
e42683f263
|
@ -276,6 +276,16 @@ function generateChallengeCreator(lang, englishPath, i18nPath) {
|
|||
({ id }) => id === challenge.id
|
||||
);
|
||||
|
||||
const isObjectIdFilename = /[a-z0-9]{24}\.md$/.test(englishPath);
|
||||
if (isObjectIdFilename) {
|
||||
const filename = englishPath.split('/').pop();
|
||||
if (filename !== `${challenge.id}.md`) {
|
||||
throw Error(
|
||||
`Filename ${filename} does not match challenge id ${challenge.id}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
challenge.block = meta.dashedName;
|
||||
challenge.blockType = meta.blockType;
|
||||
challenge.hasEditableBoundaries = !!meta.hasEditableBoundaries;
|
||||
|
|
Loading…
Reference in New Issue