Skip to content

Commit

Permalink
test: custom marker scenario for remark-inline-code-lang plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Apr 25, 2024
1 parent c122cbb commit f9cd12e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/remark-inline-code-lang/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const scenarios = [
{
title: "multiple annotated code elements",
input: "Launch the container with `sh> docker compose up -d` and run `sh> curl https://localhost:8080`"
},
{
title: "code element with custom marker",
input: "To prune a remote called origin, run `git$ git remote prune origin`",
options: {
marker: "$ "
}
}
];
const scenario = scenarios.map(s => s.title);
Expand All @@ -42,8 +49,8 @@ const pluginDirectory = "remark-inline-code-lang";
const snapshotsDirectory = "snapshots";

it.each(scenario)(`Test: %s`, async (rule) => {
const { input } = scenarios.find(s => s.title === rule);
const result = await parse(input);
const { input, options = {} } = scenarios.find(s => s.title === rule);
const result = await parse(input, options);
const snapshot = path.resolve(
currentDirectory,
testDirectory,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>To prune a remote called origin, run <code lang="git">git remote prune origin</code></p>

0 comments on commit f9cd12e

Please sign in to comment.