Skip to content

Jasmine Adapter clean equality testers added in global scope #19

@volodymyr-mykhailyk

Description

@volodymyr-mykhailyk

Jasmine have ability to add custom equality testers. However when these testers added in global scope (e.g not during actual test run) using following syntax:

jasmine.getEnv().addEqualityTester(MyEqualityTester);

they will be cleaned by jasmine adapter. Reason is that adapter recreate environment before all test are executed in the JSTD register function:

jstestdriver.pluginRegistrar.register({

name: 'jasmine',

runTestConfiguration: function(config, onTestDone, onComplete){
    if (config.getTestCaseInfo().getType() != JASMINE_TYPE) return false;
    (jasmine.currentEnv_ = new Env(onTestDone, onComplete)).execute();
    return true;
},

onTestsFinish: function(){
    jasmine.currentEnv_ = null;
    collectMode = true;
}

});

line:

(jasmine.currentEnv_ = new Env(onTestDone, onComplete)).execute();

In order to fix this adapter should extend already instantiated environment instead of creating new.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions