Skip to content

Commit

Permalink
Add test for error message regarding validation problem on _quarto.yml
Browse files Browse the repository at this point in the history
It should show full path of the YAML and so give hint that the wrong YAML could have been used.

Follow up on 54bbd97 that closed #10125
  • Loading branch information
cderv committed Oct 30, 2024
1 parent 00249a4 commit 84500d6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/docs/yaml/bad-config-yaml/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.quarto/
3 changes: 3 additions & 0 deletions tests/docs/yaml/bad-config-yaml/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
project:
title: "bad-config-yaml"
type: 1
7 changes: 7 additions & 0 deletions tests/docs/yaml/bad-config-yaml/subfolder/bad-config-yaml.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "bad-config-yaml"
---

## Quarto

This is a doc in a dummy project to check that error message is correct
18 changes: 18 additions & 0 deletions tests/smoke/yaml/config-yaml-validation.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* config-yaml-validation.test.ts
*
* Copyright (C) 2024 Posit Software, PBC
*
*/

import { testQuartoCmd } from "../../test.ts";
import { docs } from "../../utils.ts";
import { printsMessage } from "../../verify.ts";

const input = docs("yaml/bad-config-yaml/subfolder/bad-config-yaml.qmd");

testQuartoCmd(
"render",
[input],
[printsMessage("ERROR", /bad-config-yaml[\/\\]+_quarto[.]yml validation failed/)]
);

0 comments on commit 84500d6

Please sign in to comment.