mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
test: improve test coverage (#7181)
This commit is contained in:
parent
44966e19e9
commit
f219a2ac90
7 changed files with 48 additions and 14 deletions
|
@ -12,9 +12,8 @@ import {
|
|||
} from '../globUtils';
|
||||
|
||||
describe('createMatcher', () => {
|
||||
const matcher = createMatcher(GlobExcludeDefault);
|
||||
|
||||
it('match default exclude MD/MDX partials correctly', () => {
|
||||
const matcher = createMatcher(GlobExcludeDefault);
|
||||
expect(matcher('doc.md')).toBe(false);
|
||||
expect(matcher('category/doc.md')).toBe(false);
|
||||
expect(matcher('category/subcategory/doc.md')).toBe(false);
|
||||
|
@ -32,6 +31,7 @@ describe('createMatcher', () => {
|
|||
});
|
||||
|
||||
it('match default exclude tests correctly', () => {
|
||||
const matcher = createMatcher(GlobExcludeDefault);
|
||||
expect(matcher('xyz.js')).toBe(false);
|
||||
expect(matcher('xyz.ts')).toBe(false);
|
||||
expect(matcher('xyz.jsx')).toBe(false);
|
||||
|
@ -63,6 +63,13 @@ describe('createMatcher', () => {
|
|||
expect(matcher('folder/__tests__/xyz.jsx')).toBe(true);
|
||||
expect(matcher('folder/__tests__/xyz.tsx')).toBe(true);
|
||||
});
|
||||
|
||||
it('matches nothing given nothing', () => {
|
||||
const matcher = createMatcher([]);
|
||||
expect(matcher('foo')).toBe(false);
|
||||
expect(matcher('')).toBe(false);
|
||||
expect(matcher('we/are/the/champions')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('createAbsoluteFilePathMatcher', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue