eslint-plugin-jasmine
Advanced tools
Comparing version 2.3.2 to 2.4.0
@@ -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 @@ |
@@ -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'} | ||
] | ||
} | ||
] | ||
}) |
148192
1667