Skip to content

Commit 52d5a6e

Browse files
authored
Merge pull request #11031 from quarto-dev/tests/smoke-all-check
2 parents e51b07e + 8e2a032 commit 52d5a6e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/docs/smoke-all/revealjs/jump-to-slide.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ format:
44
revealjs:
55
jump-to-slide: false
66
_quarto:
7-
test:
7+
tests:
88
revealjs:
99
ensureFileRegexMatches:
1010
- ["jumpToSlide.*false,"]

tests/smoke/smoke-all.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ async function guessFormat(fileName: string): Promise<string[]> {
7878
}
7979

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

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

232236
const testSpecs: QuartoInlineTestSpec[] = [];
233237

234-
if (hasTestSpecs(metadata)) {
238+
if (hasTestSpecs(metadata, input)) {
235239
testSpecs.push(...resolveTestSpecs(input, metadata));
236240
} else {
237241
const formats = await guessFormat(input);

0 commit comments

Comments
 (0)