Files
ai-course/node_modules/eslint-plugin-jest/docs/rules/no-commented-out-tests.md
KQL ce6aa207e9 fix: 修复图片路径以适配GitHub Pages base path
- 将所有图片路径从绝对路径改为使用 process.env.PUBLIC_URL
- 修复 HomePage.tsx 中所有图片引用
- 修复 CoursePage.tsx 中所有图片引用
- 确保图片在 GitHub Pages 上正确加载

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 09:24:45 +08:00

1.3 KiB

Disallow commented out tests (no-commented-out-tests)

This rule raises a warning about commented out tests. It's similar to no-disabled-tests rule.

Rule Details

The rule uses fuzzy matching to do its best to determine what constitutes a commented out test, checking for a presence of it(, describe(, it.skip(, etc. in code comments.

The following patterns are considered warnings:

// describe('foo', () => {});
// it('foo', () => {});
// test('foo', () => {});

// describe.skip('foo', () => {});
// it.skip('foo', () => {});
// test.skip('foo', () => {});

// describe['skip']('bar', () => {});
// it['skip']('bar', () => {});
// test['skip']('bar', () => {});

// xdescribe('foo', () => {});
// xit('foo', () => {});
// xtest('foo', () => {});

/*
describe('foo', () => {});
*/

These patterns would not be considered warnings:

describe('foo', () => {});
it('foo', () => {});
test('foo', () => {});

describe.only('bar', () => {});
it.only('bar', () => {});
test.only('bar', () => {});

// foo('bar', () => {});

Limitations

The plugin looks at the literal function names within test code, so will not catch more complex examples of commented out tests, such as:

// const testSkip = test.skip;
// testSkip('skipped test', () => {});

// const myTest = test;
// myTest('does not have function body');