mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
fix: make sure ext curriculum tests fail if missing meta (#61904)
This commit is contained in:
committed by
GitHub
parent
b246d99b30
commit
efe3d22b06
@@ -72,14 +72,18 @@ ${result.error.message}`
|
||||
await readdirp.promise(`${clientStaticPath}/curriculum-data/${VERSION}`, {
|
||||
directoryFilter: ['!challenges'],
|
||||
fileFilter: entry => {
|
||||
// path without extension:
|
||||
const filePath = entry.path.replace(/\.json$/, '');
|
||||
// The directory contains super block files and other curriculum-related files.
|
||||
// We're only interested in super block ones.
|
||||
const superBlocks = Object.values(SuperBlocks);
|
||||
return superBlocks.includes(entry.basename);
|
||||
return superBlocks.includes(filePath);
|
||||
}
|
||||
})
|
||||
).map(file => file.path);
|
||||
|
||||
expect(fileArray.length).toBeGreaterThan(0);
|
||||
|
||||
fileArray.forEach(fileInArray => {
|
||||
const fileContent = fs.readFileSync(
|
||||
`${clientStaticPath}/curriculum-data/${VERSION}/${fileInArray}`,
|
||||
@@ -100,14 +104,18 @@ ${result.error.message}`);
|
||||
await readdirp.promise(`${clientStaticPath}/curriculum-data/${VERSION}`, {
|
||||
directoryFilter: ['!challenges'],
|
||||
fileFilter: entry => {
|
||||
// path without extension:
|
||||
const filePath = entry.path.replace(/\.json$/, '');
|
||||
// The directory contains super block files and other curriculum-related files.
|
||||
// We're only interested in super block ones.
|
||||
const superBlocks = Object.values(SuperBlocks);
|
||||
return superBlocks.includes(entry.basename);
|
||||
return superBlocks.includes(filePath);
|
||||
}
|
||||
})
|
||||
).map(file => file.path);
|
||||
|
||||
expect(superBlockFiles.length).toBeGreaterThan(0);
|
||||
|
||||
superBlockFiles.forEach(file => {
|
||||
const fileContentJson = fs.readFileSync(
|
||||
`${clientStaticPath}/curriculum-data/${VERSION}/${file}`,
|
||||
|
||||
Reference in New Issue
Block a user