Allow different naming conventions for tests
See original GitHub issueIn tests, I like to have very specific method names that are human readable.
For example:
fun `With input X, the output should be Y`()
However, this is not valid in Android apps.
As such, it would be nice if I could specify a different configuration for the tests in my project.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
How to name your unit tests. 4 test naming conventions
Writing long names is acceptable since test names should show the purpose behind what they're testing.
Read more >Unit test naming best practices [closed] - Stack Overflow
One test fixture per 'unit' (class of your program). Test fixtures are classes themselves. The test fixture name should be: [name of your...
Read more >Making Better Unit Tests, Part 2: naming unit tests - Manning
From Unit Testing, Principles, Practices, and Patterns by Vladimir Khorikov. In this article, we'll talk about naming unit tests.
Read more >7 Popular Strategies: Unit Test Naming Conventions - DZone
The article presents a compiled list of unit tests naming strategy that one could follow for naming their unit tests.
Read more >How to Choose the Best Unit Test Method Naming Convention
1. UnitOfWork name could be as simple as a method name (if that is the whole unit of work) or more abstract if...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can achieve this by having two different Gradle tasks with different
filters
andconfig
values. Let’s assume that all your tests are placed in directories withtest
suffix (eg.src/test
,src/sharedTest
,src/androidTest
etc)Here is example of configuration for all files except tests
Configuration for files in “test” directories
As I said, difference in
filters
andconfig
fields.Disadvantage of this approach is that you have to duplicate your configuration, because mostly it will be identical (except naming configuration)
Yes, this is how I have it set up:
Hmmm I’m thinking I have this backwards now, but you get the idea.