mnasyrov / karma-jasmine-spec-tags

A plugin for karma-jasmine which helps to filter tests (specs) by tags.
MIT License
6 stars 1 forks source link

Getting and setting `specFilter` directly from `Env` is deprecated in Jasmine 3.3.0 #1

Closed greg-fix closed 5 years ago

greg-fix commented 5 years ago

First of all, thank you for creating this helpful utility!

Issue:

With Jasmine 3.3.0 getting and setting specFilter directly from Env is deprecated. This method was deprecated in the following commit: https://github.com/jasmine/jasmine/commit/92d0882a3202e51a866c7b0dfed5393a0e9fe338. When using this utitlity and version 3.3.0 of Jasmine or higher we get the following deprecation warnings:

'DEPRECATION:', 'Getting specFilter directly from Env is deprecated, please check the specFilter option from `configuration`'
'DEPRECATION:', 'Setting specFilter directly on Env is deprecated, please use the specFilter option in `configure`'

Proposed Fix:

Update lines 20 - 21 of client.js from:

    var specFilterFnDelegate = jasmineEnv.specFilter;
    jasmineEnv.specFilter = customSpecFilter;

to:

    var specFilterFnDelegate = jasmineEnv.configuration.specFilter;
    jasmineEnv.configure({ specFilter: customSpecFilter });

Also, add the following jasmine peerDependency to package.json:

    "jasmine": "^3.3.0",

Note:

I'm happy to send a pull request with these changes; however, I believe I do not have permissions to do so at this time.

Thank you!

mnasyrov commented 5 years ago

Hi! Thank you for reporting about this, I will take a look.

mnasyrov commented 5 years ago

Fixed. Published karma-jasmine-spec-tags@1.1.0 to npm.

owenmead commented 5 years ago

This fix broke some things, which I've submitted as a fix in https://github.com/mnasyrov/karma-jasmine-spec-tags/pull/4

mnasyrov commented 5 years ago

@owenmead Thanks for the fix. I published karma-jasmine-spec-tags@1.2.0