-
Notifications
You must be signed in to change notification settings - Fork 162
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
Changes in 3.1.0 break custom karma-jasmine-html-reporter spec filtering #256
Comments
Please provide steps to reproduce. For example, a small testsuite that fails. |
Perhaps you mean: the filtering by spec name should be "grep"-like rather than exact? |
What I meant is that if there are following suites, then describe('MySuite', function(){
it("works1", function(){...});
it("works2", function(){...});
});
describe('FooBar', function(){
it("works1", function(){...});
it("works2", function(){...});
}); AFAIK, previously the match was resolved by using a regex. With the new update the match is done by strictly comparing 2 strings. This does not work as the items in specs list has name in following format: |
I think this also broke running individual specs in IntelliJ IDEA / Webstorm, which specifies suite names in the form of regex patterns, ie. |
Ok so I can imagine that my change broke you, but I can't understand how. As far as I can tell, the 2.0.1 version did not support debug URL based test selection: Is it possible that you have some additional code that is providing this URL->filter feature? The 3.1.0 feature was based on writing the fullname onto the URL and thus does not need regexp. I'm ok with trying to add that as a new feature if we agree on what it should do. |
Thanks for that. IntelliJ runs tests by executing a command similar to this:
where |
@johnjbarton Sorry my bad. I am using this for so long that the lines have blurred :P I am also using karma-jasmine-html-reporter which generates the links for the Suites as |
Ok, now we are making progress. karma-jasmine-html-reporter provides spec filtering:
No, because the previous code did not implement partial comparison, it was implemented by jasmine.HtmlSpecFilter() as you can see from the code in karma-jasmine-html-reporter linked above. So something in the 3.1 change breaks specFiltering, but you are in a much better position to figure out what that is. Since karma-jasmine did not have partial comparison code I can't bring that back. |
I reverted back to |
I have reverted my karma-jasmine to 3.0.3 but still getting the error. |
@johnjbarton adapter.js (the thing that does the spec filtering) from karma-jasmine-html-reporter is basically just a copy of boot.js from jasmine-core. All karma-jasmine-html-reporter really does is wrap jasmine's html reporter in something karma understands. So this could be seen as part of jasmine. It's my opinion that karma-jasmine should not break core jasmine functionality. |
It seems like the order in which specFilter is configured has been changed. In 3.0.3, the specFilter from karma-jasmine is set before my custom specFilter. In 3.1.0, this is the other way around, which results in my specFilter never getting executed. |
@johnjbarton The specFilter is now set in What's the reason for setting the specFilter at that stage in the process? Would it be possible to either set the specFilter at the previous stage in the process or to not override the specFilter if a custom one has been set? |
Well to be sure the reason is simple: no test fails when I made that change. |
I can confirm that With |
@MarcusRiemer That worked for me. Thanks! |
@johnjbarton that's fair. Would you be willing to accept a PR that places the code back in Thanks for the awesome work maintaining Karma. It's a very important development tool. ❤ |
Good PRs are always welcome as are more tests. |
jasmine tests are named suite-name + spec-name. The links printed by karma-jasmine-html-reporter include links for suite-name (only). To support running the suite, allow the filter to match any part of the test name. Fixes #256
🎉 This issue has been resolved in version 3.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
jasmine tests are named suite-name + spec-name. The links printed by karma-jasmine-html-reporter include links for suite-name (only). To support running the suite, allow the filter to match ONLY the START portion of the test name. Fixes karma-runner#256 karma-runner#270
#270 I think the correspondence should only be for the start portion of the test name.
And open test1 and then the corresponding subTest, I will have both the subTest, but it would be intuitive to see only the subTest correpondent to test1. I have already sent a change proposal through pr #271, if that seems appropriate. |
Allows filtering in Web based debugger again, see karma-runner/karma-jasmine#256 (comment)
As the latest version does a strict equality comparison, the filtering with suite name does not work anymore.
I am try to filter a suite from browser using the url
http://localhost:9876/debug.html?spec=MySuite
or by clicking the generated suite link (same url). It results in following error.Ideally, the generated links should work.
The text was updated successfully, but these errors were encountered: