hasEvent
JavaScript test support utility for jQuery events
![Build Status](https://travis-ci.org/skroutz/hasEvent.png?branch=master)
A way to detect the presence of jQuery events is currently a wontfix, thus this helper.
Installation
npm install @skroutz/has-event
or
bower install hasEvent
(Deprecated!!!)
Don't forget to include the lib itself, located in dist/has_event.js
Usage
The examples below use chai should style
assertions.
$('.foo').hasEvent('click', someHandler).should.be.true
$('.foo').hasEvent('custom', someHandler).should.be.true
$('body').hasEvent('click', '.foo .bar', somehandler).should.be.true
$(document).hasEvent('click', '.foo .bar', someHandler).should.be.true
$(window).hasEvent('scroll', someHandler).should.be.false
Tests
Currently there are tests against jQuery versions
1.7 up to 2.0.3
Browse the builds here
Author
Dimitris Zorbas (@zorbash)
Licence
Copyright (c) 2013 Dimitris Zorbash
Licensed under the MIT license.