Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename no-async-describe to no-async-suite #368

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,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 @@ -2,7 +2,7 @@ import globals from 'globals';
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 @@ -26,7 +26,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 @@ -52,7 +52,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 @@ -79,7 +79,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
Loading