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

Support jasmine v2 #154

Closed
wants to merge 3 commits into from
Closed

Support jasmine v2 #154

wants to merge 3 commits into from

Conversation

travisjeffery
Copy link
Collaborator

No description provided.

travisjeffery and others added 3 commits October 25, 2013 00:22
- Jasmine 2.0 doesn't allow you to grab the existing matcher and
  override it, so the matchers that did that had to be re-worked.
- toBe is now a customEqualityTester so:
  - toBe($('.foo'))
  becomes:
  - toEqual($('.foo'))
- toContain was renamed to toContainElement
@thadk
Copy link

thadk commented Jan 7, 2014

👍 This branch still seems okay--should I worry about using 1.5 rather than 1.7?

@stayce
Copy link

stayce commented Jan 7, 2014

I'm running with jasmine 2.0 and everything is working OK. Thanks

@christianvuerings
Copy link

Would be great to see this patch in, do we know when this might happen? /cc @Peeja @travisjeffery

@mdespuits
Copy link

I'm getting an error with Jasmine 2.0 and the latest version of jasmine-jquery:

    return actualValue === expectedValue
  }

  var bindMatcher = function (methodName) {
    var builtInMatcher = jasmine.Matchers.prototype[methodName]
    // Uncaught TypeError: Cannot read property 'prototype' of undefined
    jasmine.jQuery.matchersClass[methodName] = function () {
      if (this.actual

It looks like jasmine.Matchers should be jasmine.matchers, but I'm not entirely sure.

@shenst1
Copy link

shenst1 commented Jan 8, 2014

Could someone upload a working SpecRunner.html with this repository? I am having trouble running it with jasmine 2.0. I am including the file, but it always says something along the lines of expect(...).toHaveCss is not a function in /spec/PlaySound.js.
When are people loading in the jasmine-jquery in a non-rails app?

@travisjeffery
Copy link
Collaborator Author

i'll look into getting this in shortly. there will some minor api changes since jasmine 2 doesn't support all the stuff you could hook into with jasmine 1.

@shenst1
Copy link

shenst1 commented Jan 8, 2014

thanks, really appreciate it!

@mdespuits
Copy link

Awesome @travisjeffery! Looking forward to seeing it happen!

@shenst1
Copy link

shenst1 commented Jan 9, 2014

I'm still confused about whether or not I can use jasmine-jquery with Jasmine 2.0. Is it partially compatible or is it just not there yet?

@mdespuits
Copy link

@shenst1 I can't get them to play nicely. As @travisjeffery mentioned, there are a few differences, so until those are resolved/accounted for, they probably won't work together properly.

@mdespuits
Copy link

@travisjeffery Oh man. I just noticed this is a PR not an issue. I have not tested/run my code against your changes. I was running everything against the latest release. Please ignore my concerns as they probably are accounted for already.

@mdespuits
Copy link

@travisjeffery My specs now work perfectly running Jasmine 2.0 and this branch. Can this be merged and released?

Edit: with the exception of testing against the official jasmine 2.0 release and not an RC version.

travisjeffery added a commit that referenced this pull request Jan 14, 2014
@VeteranCoder
Copy link

Last week I updated to Jasmine 2.0 and jasmine-jquery 2.0.2, and I am getting crash and burn failure. I put up a question on StackOverload (http://stackoverflow.com/questions/21763470/jasmine-jquery-loadfixtures-with-jasmine-2-0-wont-work). I suspect this is related. Can someone confirm this is still an issue, or show me how to make the combination work? I rely upon it in Jasmin 1.3.1 + jasmine-jquery 1.5, and don't want to be either stuck in the past or forced to change to another framework. Thanks!

Update: with Travis' help, I solved my problem. Answer is at the above link. Thanks!

r4j4h added a commit to r4j4h/jasmine-jquery that referenced this pull request May 13, 2014
* commit 'b94ad8741909b8a48521d168a1ae6b742180122e': (77 commits)
  2.0.3
  fix velesin#179
  fix style
  fix toEqual() examples (velesin#176)
  Providing the parameters from jqXHR.fail
  2.0.2
  Update fixture to ignore script tag without src attribute
  Documentation fix
  2.0.1
  Run tests with jquery 2
  Update ajax call to work with jquery 2
  Update dependencies for jasmine v2 (close velesin#166)
  Fix matchers to be in alphabetical order and add toBeInDOM
  Update README docs for v2 (velesin#154)
  v2.0.0 - adds support for jasmine v2 (fix velesin#154, fix velesin#164)
  Update grunt-contrib-jasmine
  Run tests off of jasmine v2.0.0-rc3
  Able to bind events to fixtures
  Pass in window to the self invoking function
  1.7.0
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants