Skip to content

Commit dc95350

Browse files
committed
test, yaml - add test for render that should fail as YAML validation error
1 parent 7ca42c0 commit dc95350

7 files changed

+81
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "YAML intelligence should fail with knitr engine"
3+
engine: julia
4+
---
5+
6+
This code cell has more than default 3 backticks
7+
8+
````{julia}
9+
#| echo: 123
10+
1 + 1
11+
````
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: "YAML intelligence should fail with knitr engine"
3+
engine: julia
4+
---
5+
6+
```{julia}
7+
#| echo: 123
8+
1 + 1
9+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "YAML intelligence should fail with knitr engine"
3+
---
4+
5+
This code cell has more than default 3 backticks
6+
7+
````{python}
8+
#| echo: 123
9+
1 + 1
10+
````
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "YAML intelligence should fail with knitr engine"
3+
---
4+
5+
```{python}
6+
#| echo: 123
7+
1 + 1
8+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "YAML intelligence should fail with knitr engine"
3+
---
4+
5+
This code cell has more than default 3 backticks
6+
7+
````{r}
8+
#| echo: 123
9+
1 + 1
10+
````
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "YAML intelligence should fail with knitr engine"
3+
---
4+
5+
```{r}
6+
#| echo: 123
7+
1 + 1
8+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { testQuartoCmd } from "../../test.ts";
2+
import { fileLoader } from "../../utils.ts";
3+
import { printsMessage } from "../../verify.ts";
4+
5+
const yamlDocs = fileLoader("yaml");
6+
7+
const testYamlValidationFails = (file: string) => {
8+
testQuartoCmd(
9+
"render",
10+
[yamlDocs(file, "html").input, "--to", "html", "--log-level", "error", "--quiet"],
11+
[printsMessage("ERROR", /Validation of YAML cell metadata failed/)],
12+
);
13+
};
14+
15+
const files = [
16+
"fail-validation-knitr.qmd",
17+
"fail-validation-jupyter.qmd",
18+
"fail-validation-julia.qmd",
19+
"fail-validation-knitr-backticks.qmd",
20+
"fail-validation-jupyter-backticks.qmd",
21+
"fail-validation-julia-backticks.qmd",
22+
];
23+
24+
files.forEach(testYamlValidationFails);
25+

0 commit comments

Comments
 (0)