eslint-plugin-jest
Advanced tools
Comparing version 22.3.2 to 22.4.0
{ | ||
"name": "eslint-plugin-jest", | ||
"version": "22.3.2", | ||
"version": "22.4.0", | ||
"description": "Eslint rules for Jest", | ||
@@ -5,0 +5,0 @@ "repository": "jest-community/eslint-plugin-jest", |
@@ -99,2 +99,3 @@ [![Build Status](https://travis-ci.org/jest-community/eslint-plugin-jest.svg?branch=master)](https://travis-ci.org/jest-community/eslint-plugin-jest) | ||
| [no-disabled-tests][] | Disallow disabled tests | ![recommended][] | | | ||
| [no-empty-title][] | Disallow empty titles | | | | ||
| [no-focused-tests][] | Disallow focused tests | ![recommended][] | | | ||
@@ -135,2 +136,3 @@ | [no-hooks][] | Disallow setup and teardown hooks | | | | ||
[no-disabled-tests]: docs/rules/no-disabled-tests.md | ||
[no-empty-title]: docs/rules/no-empty-title.md | ||
[no-focused-tests]: docs/rules/no-focused-tests.md | ||
@@ -137,0 +139,0 @@ [no-hooks]: docs/rules/no-hooks.md |
@@ -72,2 +72,8 @@ 'use strict'; | ||
}, | ||
{ | ||
code: 'it(`${n}`, function() {});', | ||
env: { | ||
es6: true, | ||
}, | ||
}, | ||
[ | ||
@@ -74,0 +80,0 @@ 'describe("title " + foo, function() {', |
@@ -9,2 +9,3 @@ 'use strict'; | ||
hasExpressions, | ||
getStringValue, | ||
} = require('./util'); | ||
@@ -54,10 +55,2 @@ | ||
const getArgValue = arg => { | ||
if (arg.type === 'TemplateLiteral') { | ||
return arg.quasis[0].value.raw; | ||
} | ||
return arg.value; | ||
}; | ||
module.exports = { | ||
@@ -81,3 +74,3 @@ meta: { | ||
} | ||
const title = getArgValue(firstArgument); | ||
const title = getStringValue(firstArgument); | ||
handleTestCaseTitles(context, currentLayer.testTitles, node, title); | ||
@@ -84,0 +77,0 @@ handleDescribeBlockTitles( |
@@ -135,6 +135,11 @@ 'use strict'; | ||
(node.type === 'Literal' && typeof node.value === 'string') || | ||
node.type === 'TemplateLiteral'; | ||
isTemplateLiteral(node); | ||
const isTemplateLiteral = node => node.type === 'TemplateLiteral'; | ||
const hasExpressions = node => node.expressions && node.expressions.length > 0; | ||
const getStringValue = arg => | ||
isTemplateLiteral(arg) ? arg.quasis[0].value.raw : arg.value; | ||
/** | ||
@@ -214,4 +219,6 @@ * Generates the URL to documentation for the given rule name. It uses the | ||
getNodeName, | ||
getStringValue, | ||
isDescribe, | ||
isFunction, | ||
isTemplateLiteral, | ||
isTestCase, | ||
@@ -218,0 +225,0 @@ isString, |
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
208355
99
6040
163