Skip to content

jasminewd2 bind this to jasmine.getEnv() instead of an empty object. #22

Closed
@ghusse

Description

@ghusse

According to the docs, jasmine 2 bind this to a new empty object for each test. This object can be prepared by beforeEach, and then is passed to the test and afterEach method.

That allows to create independent variables for each test, as described in this post: https://gist.github.com/traviskaufman/11131303

The doc explains how it is supposed to work too: http://jasmine.github.io/2.0/introduction.html#section-The_%3Ccode%3Ethis%3C/code%3E_keyword

Now, my problem is that this feature is not available in protractor: instead of being a new empty object, each test receives the jasmine environment (which is always the same).

Probably due to this code:

var flowFinished = flow.execute(function() {
  fn.call(jasmine.getEnv(), asyncFnDone.fulfill);
}, 'Run ' + fnName + ' in control flow');

It is a very important feature for me to be able to get a new object on each test, it allows me to prepare the platform independently for each test (and in the future, run tests in parallel).

Is there a way to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions