eslint-plugin-jest
Advanced tools
Comparing version 21.12.0 to 21.12.1
{ | ||
"name": "eslint-plugin-jest", | ||
"version": "21.12.0", | ||
"version": "21.12.1", | ||
"description": "Eslint rules for Jest", | ||
@@ -5,0 +5,0 @@ "repository": "jest-community/eslint-plugin-jest", |
@@ -16,2 +16,3 @@ 'use strict'; | ||
'describe("foo", () => {})', | ||
'describe(`foo`, () => {})', | ||
'xdescribe("foo", () => {})', | ||
@@ -18,0 +19,0 @@ 'fdescribe("foo", () => {})', |
@@ -8,2 +8,6 @@ 'use strict'; | ||
const isString = node => | ||
(node.type === 'Literal' && typeof node.value === 'string') || | ||
node.type === 'TemplateLiteral'; | ||
const hasParams = node => node.params.length > 0; | ||
@@ -39,3 +43,3 @@ | ||
const callbackFunction = node.arguments[1]; | ||
if (name.type !== 'Literal') { | ||
if (!isString(name)) { | ||
context.report({ | ||
@@ -47,3 +51,3 @@ message: 'First argument must be name', | ||
if (callbackFunction === undefined) { | ||
context.report({ | ||
return context.report({ | ||
message: 'Describe requires name and callback arguments', | ||
@@ -53,3 +57,3 @@ loc: paramsLocation(node.arguments), | ||
} | ||
if (callbackFunction && isFunction(callbackFunction)) { | ||
if (isFunction(callbackFunction)) { | ||
if (isAsync(callbackFunction)) { | ||
@@ -56,0 +60,0 @@ context.report({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118351
3297