Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

add $expect() as a shortcut for expect($(...)) #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# jasmine-jquery [![Build Status](https://travis-ci.org/velesin/jasmine-jquery.png)](https://travis-ci.org/velesin/jasmine-jquery)


jasmine-jquery provides two extensions for the [Jasmine](http://jasmine.github.io/) JavaScript Testing Framework:
jasmine-jquery provides three extensions for the [Jasmine](http://jasmine.github.io/) JavaScript Testing Framework:

- a set of custom matchers for jQuery framework
- an API for handling HTML, CSS, and JSON fixtures in your specs
- the function `$expect(selector)`, which is a simple shortcut for `expect( $( selector ) )`.

## Installation

Expand Down
5 changes: 5 additions & 0 deletions lib/jasmine-jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,4 +829,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
window.getJSONFixture = function (url) {
return jasmine.getJSONFixtures().proxyCallTo_('read', arguments)[url]
}

window.$expect = function( selector ) {
return window.expect( $(selector) )
}

}(window, window.jasmine, window.jQuery);