Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-jasmine

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jasmine - npm Package Compare versions

Comparing version 2.8.3 to 2.8.4

13

docs/rules/new-line-before-expect.md

@@ -8,3 +8,3 @@ # Enforce new line before expect inside a suite

This rule triggers a **warning** (is set to **1** by default) whenever there is no new line before expect.
This rule triggers a **warning** (is set to **1** by default) whenever there is no new line or another except before expect.

@@ -52,1 +52,12 @@ The following pattern is considered a warning:

```
```js
describe("", function() {
it("", function() {
var a = 1;
expect(a).toBe(1);
expect(a).not.toBe(0);
});
});
```

@@ -14,7 +14,14 @@ 'use strict'

var suiteDepth = 0
var lastExpectNode
return {
CallExpression: function (node) {
if (blockRegexp.test(node.callee.name)) {
lastExpectNode = null
suiteDepth++
} else if (node.callee.name === 'expect' && suiteDepth > 0) {
if (lastExpectNode && linesDelta(node, lastExpectNode) === 1) {
lastExpectNode = node
return
}
lastExpectNode = node
const prevToken = context.getSourceCode().getTokenBefore(node)

@@ -44,1 +51,5 @@ if (prevToken) {

}
function linesDelta (node1, node2) {
return Math.abs(node1.loc.start.line - node2.loc.start.line)
}

2

package.json

@@ -54,3 +54,3 @@ {

},
"version": "2.8.3"
"version": "2.8.4"
}

@@ -44,2 +44,10 @@ 'use strict'

linesToCode([
'it("", helper(function() {',
' var a = 1',
'',
' expect(a).toBe(1);',
' expect(a).not.toBe(0);',
'}));'
]),
linesToCode([
'notJasmineTestSuite()',

@@ -46,0 +54,0 @@ 'expect(a)'

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