Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 454 Bytes

named-spy.md

File metadata and controls

20 lines (14 loc) · 454 Bytes

Enforce using named spies (named-spy)

Make sure named spies are used and the assigned variable matches the spy name. Using properly named spies makes stacktraces more obvious.

Rule details

The following are considered warnings:

var spy = jasmine.createSpy();
callback = jasmine.createSpy('success');

The following patterns are not warnings:

var success = jasmine.createSpy('success')
onError = jasmine.createSpy('onError')