Socket
Socket
Sign inDemoInstall

eslint-plugin-jasmine

Package Overview
Dependencies
0
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.2 to 2.4.0

2

docs/rules/no-unsafe-spy.md

@@ -8,2 +8,4 @@ # Enforce spies to be defined in before/after/it blocks

This rule checks for the following methods: `spyOn`, `jasmine.createSpy()`, `jasmine.createSpyObj()`.
## Rule details

@@ -10,0 +12,0 @@

5

lib/rules/no-unsafe-spy.js

@@ -27,3 +27,6 @@ 'use strict'

(node.callee.object && node.callee.object.name === 'jasmine') &&
(node.callee.property && node.callee.property.name === 'createSpy')
(
(node.callee.property && node.callee.property.name === 'createSpy') ||
(node.callee.property && node.callee.property.name === 'createSpyObj')
)
)

@@ -30,0 +33,0 @@ ) { return }

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

},
"version": "2.3.2"
"version": "2.4.0"
}

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

'})'
]),
linesToCode([
'beforeEach(function () {',
' var tape = jasmine.createSpyObj("tape", ["play", "pause"]);',
' it(function () {',
' expect(tape.play).toBeDefined();',
' })',
'})'
])

@@ -80,4 +88,17 @@ ],

]
},
{
code: linesToCode([
'describe(function () {',
' var tape = jasmine.createSpyObj("tape", ["play", "pause"]);',
' it(function () {',
' expect(tape.play).toBeDefined();',
' })',
'})'
]),
errors: [
{message: 'Spy declared outside of before/after/it block'}
]
}
]
})
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc