Skip to content
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

Update Unit Test Suite #9715

Closed
spotxslagle opened this issue Mar 27, 2023 · 3 comments
Closed

Update Unit Test Suite #9715

spotxslagle opened this issue Mar 27, 2023 · 3 comments

Comments

@spotxslagle
Copy link
Contributor

Type of issue

Maintenance

Description

The unit test suite is lacking basic features like fdescribe or xit that would be useful for development. Update the appropriate packages so that these features are supported.

@dgirardi
Copy link
Collaborator

dgirardi commented Mar 27, 2023

I do not recognize those; from a quick search they seem to be Jasmine features whose mocha equivalents are describe.only and it.skip. Do those work for you? Btw, those features look like very obvious code smell enablers, I'm positive there's a better way to do whatever you need them for. I suggest

gulp serve-and-test --file [spec_file]

or we can think about passing more filters to the test runners if a single file is still too large.

@spotxslagle
Copy link
Contributor Author

Interesting. Yeah, .skip and .only will work. Every test suite I've used must have been using Jasmine, because I hadn't realized that was mocha/jasmine difference. I've only ever seen the fdescribe/xit calls. It's the feature I want, not the syntax, so your suggestion is enough I tend to iterate a lot while writing/fixing unit tests, so being unable to isolate one or two tests has been frustrating. I wish I'd realized I just needed to take a closer look at the docs.

Thanks for your help!

@dgirardi
Copy link
Collaborator

@spotxslagle be aware that with #9693 you'll still need to pass a file - which I think makes the feature as a whole not that useful. What happened is that someone forgot to remove their .only, the reviewers didn't notice, and the pipeline started skipping all tests without telling anyone.

This is why I say it's a code smell; IMO the correct way to do that is to tell your test runner, not your test code, which subset of tests to run for fast iteration. So far --file has been enough for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants