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

Rewrite tests #35

Merged
merged 12 commits into from Mar 11, 2022
Merged

Rewrite tests #35

merged 12 commits into from Mar 11, 2022

Conversation

calvintam236
Copy link
Member

No description provided.

@calvintam236
Copy link
Member Author

@WieFel Any good idea how to test all the setters?

@WieFel
Copy link
Member

WieFel commented Mar 5, 2022

@calvintam236 probably the only way is to set some value and use the getters in the same way as you did in the getters tests

@calvintam236
Copy link
Member Author

@calvintam236 probably the only way is to set some value and use the getters in the same way as you did in the getters tests

@WieFel The problem is what are the expected value of each setter since they all return TinyColor.
For example, https://github.com/TinyCommunity/tinycolor2#lighten
Should it test TinyColor.lighten() == Color.lighten(10)?

@calvintam236 calvintam236 added the enhancement New feature or request label Mar 5, 2022
@WieFel
Copy link
Member

WieFel commented Mar 5, 2022

Not sure how to best test this...

Maybe check something like color.lighten().darken() == color.
Not sure whether this assumption actually holds or not.

@calvintam236
Copy link
Member Author

Not sure how to best test this...

Maybe check something like color.lighten().darken() == color. Not sure whether this assumption actually holds or not.

@WieFel I added the remaining tests by testing every methods independently. Should this sufficient?
Can you take a look if I made any logic error? (I hope not.)

@calvintam236 calvintam236 marked this pull request as ready for review March 9, 2022 23:27
@calvintam236 calvintam236 requested a review from WieFel March 9, 2022 23:27
@calvintam236 calvintam236 modified the milestones: v2.1.0, v2.0.1 Mar 9, 2022
@calvintam236 calvintam236 mentioned this pull request Mar 11, 2022
Copy link
Member

@WieFel WieFel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@calvintam236 calvintam236 merged commit 10b5a5a into master Mar 11, 2022
@calvintam236 calvintam236 deleted the feature/tests branch April 30, 2022 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants