Skip to content

Commit

Permalink
chore(contented): add more test coverage (#625)
Browse files Browse the repository at this point in the history
#### What this PR does / why we need it:

Add more scenarios to increase test coverage.
  • Loading branch information
fuxingloh authored Sep 28, 2023
1 parent a070396 commit 2ad8482
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/contented-pipeline-md/fixtures/Features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: 'Title Override'
description: 'Description Override'
---

# Features

```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
19 changes: 19 additions & 0 deletions packages/contented-pipeline-md/src/MarkdownPipeline.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,23 @@ describe('Without Config', () => {
},
]);
});

it('should process Features.md', async () => {
const content = await pipeline.process(rootPath, 'Features.md');
expect(content).toStrictEqual([
{
type: 'Markdown',
fields: {
description: 'Description Override',
title: 'Title Override',
},
headings: expect.any(Array),
path: '/features',
sections: [],
fileId: expect.stringMatching(/[0-f]{64}/),
modifiedDate: expect.any(Number),
html: '<nav class="toc"><ol class="toc-level toc-level-1"><li class="toc-item toc-item-h1"><a class="toc-link toc-link-h1" href="#features">Features</a></li></ol></nav><h1 id="features"><a aria-hidden="true" tabindex="-1" href="#features"><span class="icon icon-link"></span></a>Features</h1>\n<div class="mermaid">graph TD;\n A-->B;\n A-->C;\n B-->D;\n C-->D;\n</div>',
},
]);
});
});

0 comments on commit 2ad8482

Please sign in to comment.