You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently don't have a standard for the name of the test cases in table tests
Most of the time, the test case contains as a name the initial state for the specific test case. This is an example for MsgTriggerLaunch:
In my opinion, the unit tests would be more visual, if we can describe as a name, the actual purpose of the test, what the test must assert.
Example of a standard:
successful case: should allow <action> [when/if <state>]
failure case should prevent <action> [when/if <state>]
some other case should ... is sufficient
Validate method:
should validate
should prevent validate
{
name: "should allow a chain launch to be triggered when the chain launch is not yet triggered",
msg: sample.MsgTriggerLaunch(coordAddress, chainID),
},
{
name: "should prevent triggering the launch of a non existent chain",
msg: sample.MsgTriggerLaunch(coordAddress, chainIDNoExist),
err: types.ErrChainNotFound,
},
{
name: "should prevent triggering the launch of a chain from a non existent coordinator",
msg: sample.MsgTriggerLaunch(coordNoExist, chainID2),
err: profiletypes.ErrCoordAddressNotFound,
},
2- Add test description for non TDT tests
For tests where we don't use TDT format. We should include the assertion in sub-tests and add descriptions for better readability
1- Normalize test cases
We currently don't have a standard for the name of the test cases in table tests
Most of the time, the test case contains as a name the initial state for the specific test case. This is an example for
MsgTriggerLaunch
:In my opinion, the unit tests would be more visual, if we can describe as a name, the actual purpose of the test, what the test must assert.
Example of a standard:
should allow <action> [when/if <state>]
should prevent <action> [when/if <state>]
should ...
is sufficientValidate method:
should validate
should prevent validate
2- Add test description for non TDT tests
For tests where we don't use TDT format. We should include the assertion in sub-tests and add descriptions for better readability
Example:
to
Example
Normalize test cases for
launch
module #842Tasks
launch
module #843campaign
module #844reward
module #845monitoringc
module #846monitoringp
module #847profile
module #848participation
module #849claim
module #850mint
should be handled in the future, we should first adapt the tests of the module with ourtestkeeper
utility suiteThe text was updated successfully, but these errors were encountered: