Unit test command line usage is more limited than the old SpecRunner
See original GitHub issueI understand why SpecRunner was removed (to avoid maintaining it in ThirdParty
separate from npm
, but the command line testing workflow is more limiting.
One thing I do quite often in SpecRunner is to filter for tests. That way when I’m working on code, I can select a single test or many tests using ?spec=<search query>
or the “Select a unit test to run”. This is a lot easier to work with than fit/fdescribe
.
I’ve been trying out the new --includeName
and it’s not finding tests from nested describe blocks as well as the ?spec=<search query>
in the SpecRunner.html
does.
(on branch extension-revisions
) I wanted to run the tests from the describe block Scene/MetadataClassProperty > "normalize and unnormalize"
but when I run --includeName 'normalize and unnormalize'
(being very careful to use strong quotes in bash to avoid escaping the spaces) or even just --includeName normalize
, 0 tests execute so I think this test filter doesn’t look at nested describe blocks. Meanwhile in the SpecRunner, ?spec=normalize and unnormalize
works fine and gives me the 10 specs I want to run.
…I suppose I could always do fdescribe()
, though I’ve gotten used to the search query workflow that doesn’t involve fiddling with the code (and accidentally committing it in the process)
Talking about this with @ebogo1, one of the limitations is that --includeName
only has access to the top-level tests, not the inner describe blocks. That’s unfortunate.
@j9liu you had a few more limitations of using npm run test
, could you add the details in a comment here?
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (14 by maintainers)
Top GitHub Comments
This has been an issue for a while with the SpecRunner too, where some specs time out if the cursor moves. I couldn’t find an open issue for this but I don’t think it’s new behavior.
https://github.com/CesiumGS/cesium/pull/10238 is working pretty well for me, thanks! There’s a couple things that would make it even more seamless, but maybe for another PR:
npm run build
whenever there are code changes. That way I can keep the Karma window open and refresh the page whenever I make changes.Debug
button when using--debug
?