Socket
Socket
Sign inDemoInstall

eslint-plugin-jest

Package Overview
Dependencies
Maintainers
10
Versions
325
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jest - npm Package Compare versions

Comparing version 23.16.0 to 23.17.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [23.17.0](https://github.com/jest-community/eslint-plugin-jest/compare/v23.16.0...v23.17.0) (2020-06-23)
### Features
* **lowercase-name:** support `ignoreTopLevelDescribe` option ([#611](https://github.com/jest-community/eslint-plugin-jest/issues/611)) ([36fdcc5](https://github.com/jest-community/eslint-plugin-jest/commit/36fdcc553ca40bc2ca2e9ca7e04f8e9e4a315274)), closes [#247](https://github.com/jest-community/eslint-plugin-jest/issues/247)
# [23.16.0](https://github.com/jest-community/eslint-plugin-jest/compare/v23.15.0...v23.16.0) (2020-06-21)

@@ -2,0 +9,0 @@

@@ -89,1 +89,19 @@ # Enforce lowercase test names (`lowercase-name`)

```
### `ignoreTopLevelDescribe`
This option can be set to allow only the top-level `describe` blocks to have a
title starting with an upper-case letter.
Example of **correct** code for the `{ "ignoreTopLevelDescribe": true }` option:
```js
/* eslint jest/lowercase-name: ["error", { "ignoreTopLevelDescribe": true }] */
describe('MyClass', () => {
describe('#myMethod', () => {
it('does things', () => {
//
});
});
});
```

19

lib/rules/lowercase-name.js

@@ -61,2 +61,6 @@ "use strict";

additionalItems: false
},
ignoreTopLevelDescribe: {
type: 'boolean',
default: false
}

@@ -69,3 +73,4 @@ },

ignore: [],
allowedPrefixes: []
allowedPrefixes: [],
ignoreTopLevelDescribe: false
}],

@@ -75,4 +80,6 @@

ignore = [],
allowedPrefixes = []
allowedPrefixes = [],
ignoreTopLevelDescribe
}]) {
let numberOfDescribeBlocks = 0;
return {

@@ -84,2 +91,10 @@ CallExpression(node) {

if ((0, _utils.isDescribe)(node)) {
numberOfDescribeBlocks++;
if (ignoreTopLevelDescribe && numberOfDescribeBlocks === 1) {
return;
}
}
const erroneousMethod = jestFunctionName(node, allowedPrefixes);

@@ -86,0 +101,0 @@

4

package.json
{
"name": "eslint-plugin-jest",
"version": "23.16.0",
"version": "23.17.0",
"description": "Eslint rules for Jest",

@@ -105,5 +105,5 @@ "keywords": [

"@types/dedent": "^0.7.0",
"@types/eslint": "^6.1.3",
"@types/jest": "^25.1.0",
"@types/node": "^12.6.6",
"@types/prettier": "^1.19.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",

@@ -110,0 +110,0 @@ "@typescript-eslint/parser": "^2.5.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc