Files
formipay/node_modules/eslint-plugin-jest/docs/rules/no-confusing-set-timeout.md
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:02:14 +07:00

63 lines
1.3 KiB
Markdown

# Disallow confusing usages of jest.setTimeout (`no-confusing-set-timeout`)
<!-- end auto-generated rule header -->
While `jest.setTimeout` can be called multiple times anywhere within a single
test file only the last call before any test functions run will have an effect.
## Rule details
this rule checks for several confusing usages of `jest.setTimeout` that looks
like it applies to specific tests within the same file, such as:
- being called anywhere other than in global scope
- being called multiple times
- being called after other Jest functions like hooks, `describe`, `test`, or
`it`
Examples of **incorrect** code for this rule:
```js
describe('test foo', () => {
jest.setTimeout(1000);
it('test-description', () => {
// test logic;
});
});
describe('test bar', () => {
it('test-description', () => {
jest.setTimeout(1000);
// test logic;
});
});
test('foo-bar', () => {
jest.setTimeout(1000);
});
describe('unit test', () => {
beforeEach(() => {
jest.setTimeout(1000);
});
});
```
Examples of **correct** code for this rule:
```js
jest.setTimeout(500);
test('test test', () => {
// do some stuff
});
```
```js
jest.setTimeout(1000);
describe('test bar bar', () => {
it('test-description', () => {
// test logic;
});
});
```