Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgott committed Oct 8, 2024
1 parent f29c820 commit 3d20a77
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/fixtures/includes-vars-erroneous-include.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Installation

Here is a test for including variables in an MDX file.

(!install-version.mdx version="10" unsupport="9" !)
14 changes: 14 additions & 0 deletions uvu-tests/remark-includes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,20 @@ Suite("Resolves template variables in includes", () => {
assert.equal(result, expected);
});

Suite("Throws an error if a variable is unresolved and has no default", () => {
const value = readFileSync(
resolve("server/fixtures/includes-vars-erroneous-include.mdx"),
"utf-8"
);

assert.throws(() => {
transformer({
value,
path: "/content/4.0/docs/pages/filename.mdx",
});
}, "is not assigned and has no default value");
});

Suite(
"Resolves relative links in partials based on the path of the partial",
() => {
Expand Down

0 comments on commit 3d20a77

Please sign in to comment.