This commit is contained in:
Adria Navarro 2024-01-30 15:49:18 +01:00
parent 710083d9fc
commit f94e1e105a
3 changed files with 140 additions and 138 deletions

File diff suppressed because it is too large Load Diff

View File

@ -115,7 +115,7 @@ function getCommentInfo(file, func) {
docs.example = docs.example.replace("product", "multiply") docs.example = docs.example.replace("product", "multiply")
} }
docs.description = blocks[0].trim() docs.description = blocks[0].trim()
docs.isBlock = docs.tags.some(el => el.title === "block") docs.requiresBlock = docs.tags.some(el => el.title === "block")
return docs return docs
} }
@ -160,7 +160,7 @@ function run() {
numArgs: args.length, numArgs: args.length,
example: jsDocInfo.example || undefined, example: jsDocInfo.example || undefined,
description: jsDocInfo.description, description: jsDocInfo.description,
isBlock: jsDocInfo.isBlock, requiresBlock: jsDocInfo.requiresBlock,
}) })
} }
outputJSON[collection] = collectionInfo outputJSON[collection] = collectionInfo

View File

@ -58,8 +58,8 @@ const examples = collections.reduce((acc, collection) => {
} }
} }
} }
const hasHbsBody = details.isBlock const requiresHbsBody = details.requiresBlock
return [name, { hbs, js, hasHbsBody }] return [name, { hbs, js, requiresHbsBody }]
}) })
.filter(x => !!x) .filter(x => !!x)
@ -110,7 +110,9 @@ describe("manifest", () => {
describe("can be parsed and run as js", () => { describe("can be parsed and run as js", () => {
describe.each(Object.keys(examples))("%s", collection => { describe.each(Object.keys(examples))("%s", collection => {
it.each( it.each(
examples[collection].filter(([_, { hasHbsBody }]) => !hasHbsBody) examples[collection].filter(
([_, { requiresHbsBody }]) => !requiresHbsBody
)
)("%s", async (_, { hbs, js }) => { )("%s", async (_, { hbs, js }) => {
const context = { const context = {
double: i => i * 2, double: i => i * 2,