-
Notifications
You must be signed in to change notification settings - Fork 22
Custom assertions #7
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
Conversation
I'm not married to this design at all--it might be easier for the user and to integrate state into the |
Yeah, it's difficult because of the original design. If we can start over, we can simplify all this to:
|
Yeah, it's not hard to do this with a bit of redesign and keeping state differently. Just give a holler if you want me to work on it. I'm sure there's a good reason for it, but I guess unittest has to be adapted to work with the runner so that the proper stdout can be printed? |
Do you mean the reason behind the original design? I don't think there was any "design" and that's the problem. If I remember correctly, Codewars test framework was created for JavaScript in the early days and it was decided that other languages should also have the similar API so custom frameworks for Ruby and Python were also written in the same way.
I'm not sure how it can be adapted, but I'm interested if you have some idea in mind. I was thinking maybe we can change how the assertions work only when it's used inside |
I don't have an idea for making unittest work with the necessary CW stdout elements but I figured there was some trick that Q uses for this and could be adapted for CW as well. Yeah, the simplified flow is promising but I think it'd take a bit of a redesign that felt invasive to propose. The current approach prints |
No, Q just uses
I think changing to a single |
Let's discuss and do small experiments before actually working on it. Also, we should have some tests set up. Something like:
And compare the actual output against the expected after removing things that's expected to be different like durations. |
I like the single On tests, yes--I was thinking of this when working on the repo. Right, that makes sense for unittest, but I'm still not quite understanding why the same strategy isn't available for CW--backwards compatibility locks in the custom library, though. |
Can you elaborate on the same strategy? I don't think I'm following. Qualified have the same problem. |
Isn't it possible to use both unittest with a customer reporter alongside CW/Q unit tests? I know there is a dropdown option, but I'm assuming ultimately they have to emit the same stdout tags that the runner needs to display the results, so I assume that it's possible to plug n play different test libraries with the runner, as long as they ultimately generate the right standard output. |
That should be possible. Just need to also include the code to set up the custom reporter and to run the tests. You actually don't even need to use any code from this repo or In the future, Codewars will allow authors to choose the test framework to use just like Qualified. |
No description provided.