question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unit test command line usage is more limited than the old SpecRunner

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
ebogo1commented, Mar 16, 2022

When I put the Karma tab in the background, some tests about the render loop timeout.

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.

0reactions
IanLilleyTcommented, Mar 29, 2022

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:

  • Have Karma watch files automatically instead of doing 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.
  • A way to avoid clicking the Debug button when using --debug?
Read more comments on GitHub >

github_iconTop Results From Across the Web

Changes to unit test debugging in CesiumJS
Unit test command line usage is more limited than the old SpecRunner · Issue #10200 · CesiumGS/cesium · GitHub.
Read more >
Factor out "defer" usage for better error handling · Issue #10178
However, the recommended best practice is to use new Promise ... Unit test command line usage is more limited than the old SpecRunner...
Read more >
Pycharm : Cant run unit tests with command line arguments
For my own tests, this works fine. But I can't speak to how well this approach may, or may not generalize for more...
Read more >
Command Line Usage — SpecFlow+ Runner documentation
You can run SpecFlow+ tests from the command line, either using SpecRun.exe (Full Framework) or dotnet test or vstest.console.exe (.NET Core). Syntax Changes...
Read more >
Frontend testing standards and style guidelines - GitLab Docs
The line between unit and integration tests can be quite blurry in a component heavy world. The most important guideline to give is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found