Files
ai-course/node_modules/eslint-plugin-jest/docs/rules/no-focused-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.4 KiB
Raw Blame History

Disallow focused tests (no-focused-tests)

Jest has a feature that allows you to focus tests by appending .only or prepending f to a test-suite or a test-case. This feature is really helpful to debug a failing test, so you dont have to execute all of your tests. After you have fixed your test and before committing the changes you have to remove .only to ensure all tests are executed on your build system.

This rule reminds you to remove .only from your tests by raising a warning whenever you are using the exclusivity feature.

Rule Details

This rule looks for every describe.only, it.only, test.only, fdescribe, and fit occurrences within the source code. Of course there are some edge-cases which cant be detected by this rule e.g.:

const describeOnly = describe.only;
describeOnly.apply(describe);

The following patterns are considered warnings:

describe.only('foo', () => {});
it.only('foo', () => {});
describe['only']('bar', () => {});
it['only']('bar', () => {});
test.only('foo', () => {});
test['only']('bar', () => {});
fdescribe('foo', () => {});
fit('foo', () => {});
fit.each`
  table
`();

These patterns would not be considered warnings:

describe('foo', () => {});
it('foo', () => {});
describe.skip('bar', () => {});
it.skip('bar', () => {});
test('foo', () => {});
test.skip('bar', () => {});
it.each()();
it.each`
  table
`();
test.each()();
test.each`
  table
`();