mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 13:22:26 +02:00
fix(utils): always match exclusion root dirs as complete folder paths (#7864)
* fix(utils): always match exclusion root dirs as complete folder paths * fix * fix? * fix for real
This commit is contained in:
parent
3a0e90eacd
commit
40827c6c72
5 changed files with 35 additions and 5 deletions
|
@ -113,4 +113,21 @@ describe('createAbsoluteFilePathMatcher', () => {
|
|||
`"createAbsoluteFilePathMatcher unexpected error, absoluteFilePath=/bad/path/myDoc.md was not contained in any of the root folders: /_root/docs, /root/_docs/, /__test__/website/src"`,
|
||||
);
|
||||
});
|
||||
|
||||
it('matches paths with overlapping paths', () => {
|
||||
const overlapMatcher = createAbsoluteFilePathMatcher(GlobExcludeDefault, [
|
||||
'/root/docs',
|
||||
'/root/versioned_docs/version-2.0.0',
|
||||
'/root/versioned_docs/version-2.0.0-rc.1',
|
||||
]);
|
||||
expect(
|
||||
overlapMatcher('/root/versioned_docs/version-2.0.0-rc.1/_partial.mdx'),
|
||||
).toBe(true);
|
||||
expect(
|
||||
overlapMatcher('/root/versioned_docs/version-2.0.0/_partial.mdx'),
|
||||
).toBe(true);
|
||||
expect(
|
||||
overlapMatcher('/root/versioned_docs/version-2.0.0/no-partial.mdx'),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue