17 lines
703 B
TypeScript
17 lines
703 B
TypeScript
|
|
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||
|
|
import * as smartdocumentation from '../ts/index.js';
|
||
|
|
|
||
|
|
tap.test('should read markdown files from a documentation directory', async () => {
|
||
|
|
const documentationDirectory = new smartdocumentation.DocumentationDirectory({
|
||
|
|
pathArg: './test/fixtures/docs',
|
||
|
|
});
|
||
|
|
await documentationDirectory.readDirectory();
|
||
|
|
|
||
|
|
expect(documentationDirectory.articles.length).toEqual(1);
|
||
|
|
expect(documentationDirectory.articles[0].title).toEqual('Fixture Article');
|
||
|
|
expect(documentationDirectory.articles[0].author.firstName).toEqual('Jane');
|
||
|
|
expect(documentationDirectory.articles[0].tags[0]).toEqual('path:article.md');
|
||
|
|
});
|
||
|
|
|
||
|
|
export default tap.start();
|