Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/docs/smoke-all/revealjs/jump-to-slide.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ format:
revealjs:
jump-to-slide: false
_quarto:
test:
tests:
revealjs:
ensureFileRegexMatches:
- ["jumpToSlide.*false,"]
Expand Down
10 changes: 7 additions & 3 deletions tests/smoke/smoke-all.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ async function guessFormat(fileName: string): Promise<string[]> {
}

//deno-lint-ignore no-explicit-any
function hasTestSpecs(metadata: any): boolean {
return metadata?.["_quarto"]?.["tests"] != undefined;
function hasTestSpecs(metadata: any, input: string): boolean {
const hasTestSpecs = metadata?.["_quarto"]?.["tests"] != undefined
if (!hasTestSpecs && metadata?.["_quarto"]?.["test"] != undefined) {
throw new Error(`Test is ${input} is using 'test' in metadata instead of 'tests'. This is probably a typo.`);
}
return hasTestSpecs
}

interface QuartoInlineTestSpec {
Expand Down Expand Up @@ -231,7 +235,7 @@ for (const { path: fileName } of files) {

const testSpecs: QuartoInlineTestSpec[] = [];

if (hasTestSpecs(metadata)) {
if (hasTestSpecs(metadata, input)) {
testSpecs.push(...resolveTestSpecs(input, metadata));
} else {
const formats = await guessFormat(input);
Expand Down
Loading