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

Commit

Permalink
Add a failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgott committed Oct 8, 2024
1 parent 48e9ee6 commit c32d754
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/fixtures/includes-vars-erroneous-include-result.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Installation

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

Here are instructions for installing version 10:

```code
$ curl -OL https://example.com/downloads/mysoftware-v10.tar
$ tar -xvf mysoftware-v10.tar
```

We no longer support version .
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" !)
19 changes: 19 additions & 0 deletions uvu-tests/remark-includes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,25 @@ Suite("Resolves template variables in includes", () => {
assert.equal(result, expected);
});

Suite("Removes unresolved template variables", () => {
const value = readFileSync(
resolve("server/fixtures/includes-vars-erroneous-include.mdx"),
"utf-8"
);

const expected = readFileSync(
resolve("server/fixtures/includes-vars-erroneous-include-result.mdx"),
"utf-8"
);

const result = transformer({
value,
path: "/content/4.0/docs/pages/filename.mdx",
}).toString();

assert.equal(result, expected);
});

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

0 comments on commit c32d754

Please sign in to comment.