Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jasmine expects with CSS selectors failing #6

Open
crispydc opened this issue Apr 24, 2015 · 0 comments
Open

Jasmine expects with CSS selectors failing #6

crispydc opened this issue Apr 24, 2015 · 0 comments

Comments

@crispydc
Copy link

Hi,

I'm trying to get karma-jasmine-jquery working on a new project and I'm having some trouble - I'm not sure where the issue is. I am using karma-jasmine version 0.3.5, jasmine-core 2.2.0, and karma-jasmine-jquery 0.1.1. When I try to run this test:

describe("experimentation", function() {
  var elem;
  beforeEach(function() {
  elem = $('<div id="container"><p>Hello World</p></div>');
  });
  it("allows us to serach with Css selectors", function() {
   expect(elem).toBe('#container');
   expect(elem).toContainElement('p');
    expect(elem).toEqual('#container');
   expect(elem).toEqual('p')
  });
 });

and I get the following errors:

experimentation
    ✗ allows us to serach with Css selectors
    Expected ({ 0: HTMLNode, length: 1 }) to be '#container'.
        at /var/folders/zg/yn1mt9m55w385c2k_jkyd9_5xztm6l/T/dda6e3ae7d9f204ac6ce90332d2945ef.browserify:4211

    Expected ({ 0: HTMLNode, length: 1 }) to equal '#container'.
        at /var/folders/zg/yn1mt9m55w385c2k_jkyd9_5xztm6l/T/dda6e3ae7d9f204ac6ce90332d2945ef.browserify:4213

    Expected ({ 0: HTMLNode, length: 1 }) to equal 'p'.
        at /var/folders/zg/yn1mt9m55w385c2k_jkyd9_5xztm6l/T/dda6e3ae7d9f204ac6ce90332d2945ef.browserify:4214

Is there a version conflict that I'm not seeing? I know that jasmine-jquery is loaded because I can load fixtures without any issues and the method toContainElement works fine. It seems that only the jQuery selectors are affected.

Not sure if the issue lies with this library, one of the jasmine libraries, or (most likely) something I'm doing wrong. Any help you could provide would be much appreciated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant