bashunit icon indicating copy to clipboard operation
bashunit copied to clipboard

The providers generate a poor dev-friendly output

Open antonio-gg-dev opened this issue 1 year ago • 0 comments

When you use providers, the name of the test is printed over and over without indicating with which argument of the provider it is being executed, this is unfriendly since while you are developing you do not know if the provider is really working as we expect, or if the tests are being executed passing the arguments we want.

imagen

For this, I think it would be good to make the following changes:

Milestone 1:

Done: https://github.com/TypedDevs/bashunit/pull/204

Print, in parentheses to the right of the name of the test, the arguments with which it is being provided.

✓ Passed: Returns fizz when multiple of 3 given (3)
✓ Passed: Returns fizz when multiple of 3 given (6)
✓ Passed: Returns fizz when multiple of 5 given (5)
✓ Passed: Returns fizz when multiple of 5 given (10)

Milestone 2:

Allow interpolating these arguments in the names of the tests through some special syntax, for example ::1::, ::2::...

function test_returns_fizz_when_multiple_of_3_like_::1::_given() { ... }
function test_returns_fizz_when_multiple_of_5_like_::1::_given() { ... }
✓ Passed: Returns fizz when multiple of 3 like '3' given
✓ Passed: Returns fizz when multiple of 3 like '6' given
✓ Passed: Returns fizz when multiple of 5 like '5' given
✓ Passed: Returns fizz when multiple of 5 like '10' given

antonio-gg-dev avatar Oct 21 '23 11:10 antonio-gg-dev