refactor: handle certs separately (#44434)
* refactor: split createChallenge into two functions * refactor: remove certification metas * fix: remove the metas I missed
This commit is contained in:
committed by
GitHub
parent
40acfa708b
commit
9ad29e03d5
@ -198,7 +198,10 @@ async function setup() {
|
||||
const meta = {};
|
||||
for (const challenge of challenges) {
|
||||
const dashedBlockName = challenge.block;
|
||||
if (!meta[dashedBlockName]) {
|
||||
// certifications do not have dashedBlockName's and don't have metas so
|
||||
// we can skip them.
|
||||
// TODO: omit certifications from the list of challenges
|
||||
if (dashedBlockName && !meta[dashedBlockName]) {
|
||||
meta[dashedBlockName] = await getMetaForBlock(dashedBlockName);
|
||||
}
|
||||
}
|
||||
@ -296,6 +299,9 @@ function populateTestsForLang({ lang, challenges, meta }) {
|
||||
this.timeout(5000);
|
||||
challenges.forEach((challenge, id) => {
|
||||
const dashedBlockName = challenge.block;
|
||||
// TODO: once certifications are not included in the list of challenges,
|
||||
// stop returning early here.
|
||||
if (typeof dashedBlockName === 'undefined') return;
|
||||
describe(challenge.block || 'No block', function () {
|
||||
describe(challenge.title || 'No title', function () {
|
||||
// Note: the title in meta.json are purely for human readability and
|
||||
|
Reference in New Issue
Block a user