-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for error message regarding validation problem on _quarto.yml
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
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/.quarto/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
7
tests/docs/yaml/bad-config-yaml/subfolder/bad-config-yaml.qmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/)] | ||
); |