Skip to content

Commit

Permalink
Merge pull request #11244 from quarto-dev/test/config-fail-error
Browse files Browse the repository at this point in the history
Add test for error message regarding validation problem on _quarto.yml
  • Loading branch information
cscheid authored Oct 30, 2024
2 parents 15693a5 + 84500d6 commit 72304b9
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 72304b9

Please sign in to comment.