no_disabled_tests

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoDisabledTestsRule = rule.Rule{
	Name: "jest/no-disabled-tests",
	Run: func(ctx rule.RuleContext, options any) rule.RuleListeners {
		return rule.RuleListeners{
			ast.KindCallExpression: func(node *ast.Node) {
				if isPendingCall(node, ctx) {
					ctx.ReportNode(node, buildErrorSkippedTestMessage())
					return
				}

				jestFnCall := utils.ParseJestFnCall(node, ctx)
				if jestFnCall == nil ||
					jestFnCall.Kind != utils.JestFnTypeDescribe &&
						jestFnCall.Kind != utils.JestFnTypeTest {
					return
				}

				if strings.HasPrefix(jestFnCall.Name, "x") ||
					slices.Contains(jestFnCall.Members, "skip") {
					ctx.ReportNode(node, buildErrorSkippedTestMessage())
				}

				if jestFnCall.Kind == utils.JestFnTypeTest {
					if len(node.Arguments()) < 2 && !slices.Contains(jestFnCall.Members, "todo") {
						ctx.ReportNode(node, buildErrorMissingFunctionMessage())
					}
				}
			},
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL