test: enable a few jest eslint rules (#6900)

* test: enable a few jest eslint rules

* more
This commit is contained in:
Joshua Chen 2022-03-12 08:43:09 +08:00 committed by GitHub
parent 1efc6c6091
commit aa5a2d4c04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
155 changed files with 3644 additions and 3478 deletions

View file

@ -14,7 +14,7 @@ import {
describe('createMatcher', () => {
const matcher = createMatcher(GlobExcludeDefault);
test('match default exclude MD/MDX partials correctly', () => {
it('match default exclude MD/MDX partials correctly', () => {
expect(matcher('doc.md')).toEqual(false);
expect(matcher('category/doc.md')).toEqual(false);
expect(matcher('category/subcategory/doc.md')).toEqual(false);
@ -31,7 +31,7 @@ describe('createMatcher', () => {
expect(matcher('category/_subcategory/doc.md')).toEqual(true);
});
test('match default exclude tests correctly', () => {
it('match default exclude tests correctly', () => {
expect(matcher('xyz.js')).toEqual(false);
expect(matcher('xyz.ts')).toEqual(false);
expect(matcher('xyz.jsx')).toEqual(false);
@ -73,7 +73,7 @@ describe('createAbsoluteFilePathMatcher', () => {
rootFolders,
);
test('match default exclude MD/MDX partials correctly', () => {
it('match default exclude MD/MDX partials correctly', () => {
expect(matcher('/_root/docs/myDoc.md')).toEqual(false);
expect(matcher('/_root/docs/myDoc.mdx')).toEqual(false);
expect(matcher('/root/_docs/myDoc.md')).toEqual(false);
@ -93,13 +93,13 @@ describe('createAbsoluteFilePathMatcher', () => {
expect(matcher('/root/_docs/_category/myDoc.mdx')).toEqual(true);
});
test('match default exclude tests correctly', () => {
it('match default exclude tests correctly', () => {
expect(matcher('/__test__/website/src/xyz.js')).toEqual(false);
expect(matcher('/__test__/website/src/__test__/xyz.js')).toEqual(true);
expect(matcher('/__test__/website/src/xyz.test.js')).toEqual(true);
});
test('throw if file is not contained in any root doc', () => {
it('throw if file is not contained in any root doc', () => {
expect(() =>
matcher('/bad/path/myDoc.md'),
).toThrowErrorMatchingInlineSnapshot(