Files
formipay/node_modules/eslint-plugin-jest/docs/rules/consistent-test-it.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

95 lines
1.9 KiB
Markdown

# Enforce `test` and `it` usage conventions (`consistent-test-it`)
🔧 This rule is automatically fixable by the
[`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
<!-- end auto-generated rule header -->
Jest allows you to choose how you want to define your tests, using the `it` or
the `test` keywords, with multiple permutations for each:
- **it:** `it`, `xit`, `fit`, `it.only`, `it.skip`.
- **test:** `test`, `xtest`, `test.only`, `test.skip`.
## Rule details
This rule gives you control over the usage of these keywords in your codebase.
## Options
This rule can be configured as follows
```json5
{
type: 'object',
properties: {
fn: {
enum: ['it', 'test'],
},
withinDescribe: {
enum: ['it', 'test'],
},
},
additionalProperties: false,
}
```
#### fn
Decides whether to use `test` or `it`.
#### withinDescribe
Decides whether to use `test` or `it` within a `describe` scope.
```js
/*eslint jest/consistent-test-it: ["error", {"fn": "test"}]*/
test('foo'); // valid
test.only('foo'); // valid
it('foo'); // invalid
it.only('foo'); // invalid
```
```js
/*eslint jest/consistent-test-it: ["error", {"fn": "it"}]*/
it('foo'); // valid
it.only('foo'); // valid
test('foo'); // invalid
test.only('foo'); // invalid
```
```js
/*eslint jest/consistent-test-it: ["error", {"fn": "it", "withinDescribe": "test"}]*/
it('foo'); // valid
describe('foo', function () {
test('bar'); // valid
});
test('foo'); // invalid
describe('foo', function () {
it('bar'); // invalid
});
```
The default configuration forces all top-level tests to use `test` and all tests
nested within `describe` to use `it`.
```js
/*eslint jest/consistent-test-it: ["error"]*/
test('foo'); // valid
describe('foo', function () {
it('bar'); // valid
});
it('foo'); // invalid
describe('foo', function () {
test('bar'); // invalid
});
```