Skip to content

Commit

Permalink
Merge pull request #368 from lo1tuma/describe-to-suite
Browse files Browse the repository at this point in the history
Rename no-async-describe to no-async-suite
  • Loading branch information
lo1tuma authored Jan 23, 2025
2 parents c9fdcb5 + 8cf94e0 commit 71c8de5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ See [Configuring Eslint](http://eslint.org/docs/user-guide/configuring) on [esli
| [consistent-spacing-between-blocks](docs/rules/consistent-spacing-between-blocks.md) | Require consistent spacing between blocks || | | 🔧 |
| [handle-done-callback](docs/rules/handle-done-callback.md) | Enforces handling of callbacks for async tests || | | |
| [max-top-level-suites](docs/rules/max-top-level-suites.md) | Enforce the number of top-level suites in a single file || | | |
| [no-async-describe](docs/rules/no-async-describe.md) | Disallow async functions passed to a suite || | | 🔧 |
| [no-async-suite](docs/rules/no-async-suite.md) | Disallow async functions passed to a suite || | | 🔧 |
| [no-empty-description](docs/rules/no-empty-description.md) | Disallow empty test descriptions || | | |
| [no-exclusive-tests](docs/rules/no-exclusive-tests.md) | Disallow exclusive tests | || | |
| [no-exports](docs/rules/no-exports.md) | Disallow exports from test files || | | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Disallow async functions passed to a suite (`mocha/no-async-describe`)
# Disallow async functions passed to a suite (`mocha/no-async-suite`)

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/lo1tuma/eslint-plugin-mocha#configs).

Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { consistentInterfaceRule } from './lib/rules/consistent-interface.js';
import { consistentSpacingBetweenBlocksRule } from './lib/rules/consistent-spacing-between-blocks.js';
import { handleDoneCallbackRule } from './lib/rules/handle-done-callback.js';
import { maxTopLevelSuitesRule } from './lib/rules/max-top-level-suites.js';
import { noAsyncDescribeRule } from './lib/rules/no-async-describe.js';
import { noAsyncSuiteRule } from './lib/rules/no-async-suite.js';
import { noEmptyDescriptionRule } from './lib/rules/no-empty-description.js';
import { noExclusiveTestsRule } from './lib/rules/no-exclusive-tests.js';
import { noExportsRule } from './lib/rules/no-exports.js';
Expand All @@ -27,7 +27,7 @@ import { validTestDescriptionRule } from './lib/rules/valid-test-description.js'
const allRules = {
'mocha/handle-done-callback': 'error',
'mocha/max-top-level-suites': 'error',
'mocha/no-async-describe': 'error',
'mocha/no-async-suite': 'error',
'mocha/no-exclusive-tests': 'error',
'mocha/no-exports': 'error',
'mocha/no-global-tests': 'error',
Expand All @@ -54,7 +54,7 @@ const allRules = {
const recommendedRules = {
'mocha/handle-done-callback': 'error',
'mocha/max-top-level-suites': ['error', { limit: 1 }],
'mocha/no-async-describe': 'error',
'mocha/no-async-suite': 'error',
'mocha/no-exclusive-tests': 'warn',
'mocha/no-exports': 'error',
'mocha/no-global-tests': 'error',
Expand All @@ -81,7 +81,7 @@ const mochaPlugin = {
rules: {
'handle-done-callback': handleDoneCallbackRule,
'max-top-level-suites': maxTopLevelSuitesRule,
'no-async-describe': noAsyncDescribeRule,
'no-async-suite': noAsyncSuiteRule,
'no-exclusive-tests': noExclusiveTestsRule,
'no-exports': noExportsRule,
'no-global-tests': noGlobalTestsRule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ function fixAsyncFunction(sourceCode, fixer, fn) {
return undefined;
}

export const noAsyncDescribeRule = {
export const noAsyncSuiteRule = {
meta: {
type: 'problem',
docs: {
description: 'Disallow async functions passed to a suite',
url: 'https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-async-describe.md'
url: 'https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-async-suite.md'
},
fixable: 'code',
schema: []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { RuleTester } from 'eslint';
import { noAsyncDescribeRule } from '../../lib/rules/no-async-describe.js';
import { noAsyncSuiteRule } from '../../lib/rules/no-async-suite.js';
const ruleTester = new RuleTester({ languageOptions: { sourceType: 'script' } });

ruleTester.run('no-async-describe', noAsyncDescribeRule, {
ruleTester.run('no-async-suite', noAsyncSuiteRule, {
valid: [
'describe()',
'describe("hello")',
Expand Down

0 comments on commit 71c8de5

Please sign in to comment.