eslint-plugin-jest
Advanced tools
Comparing version 22.7.0 to 22.7.1
@@ -14,3 +14,3 @@ 'use strict'; | ||
ruleTester.run('no-empty-title', rule, { | ||
valid: ['someFn("", function () {})', 'describe(1, function () {})', 'describe("foo", function () {})', 'describe("foo", function () { it("bar", function () {}) })', 'test("foo", function () {})', 'test(`foo`, function () {})', 'test(`${foo}`, function () {})', "it('foo', function () {})", "xdescribe('foo', function () {})", "xit('foo', function () {})", "xtest('foo', function () {})"], | ||
valid: ['describe()', 'someFn("", function () {})', 'describe(1, function () {})', 'describe("foo", function () {})', 'describe("foo", function () { it("bar", function () {}) })', 'test("foo", function () {})', 'test(`foo`, function () {})', 'test(`${foo}`, function () {})', "it('foo', function () {})", "xdescribe('foo', function () {})", "xit('foo', function () {})", "xtest('foo', function () {})"], | ||
invalid: [{ | ||
@@ -17,0 +17,0 @@ code: 'describe("", function () {})', |
@@ -82,11 +82,11 @@ 'use strict'; | ||
const isDescribe = node => node.type === 'CallExpression' && describeAliases[getNodeName(node.callee)]; | ||
const isDescribe = node => node && node.type === 'CallExpression' && describeAliases[getNodeName(node.callee)]; | ||
const isFunction = node => node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression'; | ||
const isFunction = node => node && (node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression'); | ||
const isString = node => node.type === 'Literal' && typeof node.value === 'string' || isTemplateLiteral(node); | ||
const isString = node => node && (node.type === 'Literal' && typeof node.value === 'string' || isTemplateLiteral(node)); | ||
const isTemplateLiteral = node => node.type === 'TemplateLiteral'; | ||
const isTemplateLiteral = node => node && node.type === 'TemplateLiteral'; | ||
const hasExpressions = node => node.expressions && node.expressions.length > 0; | ||
const hasExpressions = node => node && node.expressions && node.expressions.length > 0; | ||
@@ -93,0 +93,0 @@ const getStringValue = arg => isTemplateLiteral(arg) ? arg.quasis[0].value.raw : arg.value; |
{ | ||
"name": "eslint-plugin-jest", | ||
"version": "22.7.0", | ||
"version": "22.7.1", | ||
"description": "Eslint rules for Jest", | ||
@@ -5,0 +5,0 @@ "repository": "jest-community/eslint-plugin-jest", |
@@ -14,2 +14,3 @@ 'use strict'; | ||
valid: [ | ||
'describe()', | ||
'someFn("", function () {})', | ||
@@ -16,0 +17,0 @@ 'describe(1, function () {})', |
@@ -128,14 +128,20 @@ 'use strict'; | ||
const isDescribe = node => | ||
node.type === 'CallExpression' && describeAliases[getNodeName(node.callee)]; | ||
node && | ||
node.type === 'CallExpression' && | ||
describeAliases[getNodeName(node.callee)]; | ||
const isFunction = node => | ||
node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression'; | ||
node && | ||
(node.type === 'FunctionExpression' || | ||
node.type === 'ArrowFunctionExpression'); | ||
const isString = node => | ||
(node.type === 'Literal' && typeof node.value === 'string') || | ||
isTemplateLiteral(node); | ||
node && | ||
((node.type === 'Literal' && typeof node.value === 'string') || | ||
isTemplateLiteral(node)); | ||
const isTemplateLiteral = node => node.type === 'TemplateLiteral'; | ||
const isTemplateLiteral = node => node && node.type === 'TemplateLiteral'; | ||
const hasExpressions = node => node.expressions && node.expressions.length > 0; | ||
const hasExpressions = node => | ||
node && node.expressions && node.expressions.length > 0; | ||
@@ -142,0 +148,0 @@ const getStringValue = arg => |
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
387870
11643