You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added the new nursery rule [useConsistentTestIt](https://biomejs.dev/linter/rules/use-consistent-test-it/) in the `test` domain. The rule enforces consistent use of either `it` or `test` for test functions in Jest/Vitest suites, with separate control for top-level tests and tests inside `describe` blocks.
6
+
7
+
Invalid:
8
+
9
+
```js
10
+
test("should fly", () => {}); // Top-level test using 'test' flagged, convert to 'it'
11
+
12
+
describe('pig', () => {
13
+
test("should fly", () => {}); // Test inside 'describe' using 'test' flagged, convert to 'it'
/// Also, the module includes implementation to convert rule options to Biome's rule options.
5
+
use biome_deserialize_macros::Deserializable;
6
+
use biome_rule_options::use_consistent_test_it::{TestFunctionKind,UseConsistentTestItOptions};
7
+
8
+
/// Options for the [jest/consistent-test-it](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/consistent-test-it.md) rule.
9
+
///
10
+
/// Note: ESLint's default for `fn` is `"test"`, while Biome's default is `"it"`.
11
+
#[derive(Debug,Default,Deserializable)]
12
+
pub(crate)structConsistentTestItOptions{
13
+
/// The function to prefer for top-level tests. Defaults to `"test"` in ESLint.
14
+
#[deserializable(rename = "fn")]
15
+
pubfunction:Option<EslintTestFunctionKind>,
16
+
/// The function to prefer inside `describe` blocks. Defaults to the value of `fn`.
i Use it consistently for all test function calls.
111
+
112
+
i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
0 commit comments