7 kyu
Fix my method
1,431emporio
Loading description...
Debugging
Object-oriented Programming
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Suggested changes to the label.
Now even your own solution doesn't pass any more.
The tests were using Chai's
assert.propertyVal
, e.g.assert.propertyVal(myFunction(), objProperty)
, but it should beassert.propertyVal(obj, prop, valueOfProp)
(which is why it expectedundefined
).I just got rid of these tests since I don't know how one expects to tell if the method was called by checking
myFunction()
's properties.Tests are not passed with any existing solution, something is wrong?
These tests are completely wrong:
assert.propertyVal(myFunction(), 'objMethod'); assert.propertyVal(myFunction(), 'objProperty');
Anyone know what this error message is all about? "it" calls must be invoked within a parent "describe" context
My solution passes when I try to submit, but I'm getting that message when I run the test.
function myFunction() { var MyObject = { objProperty: "string", objMethod: function() { return this.objProperty; } } return MyObject; }
Should be okay now, I wrapped the example test in a parent describe context.
So I have used Chai-JS to assert that the myObject is being utilized. Still requires more testing though.
Requires more tests
Was not able to make more tests. Instead I changed the description of the kata.
If there is someone who can contribute to the unit tests that would be great!
Could use further tests so that just making the function return 'string' doesn't solve the kata.
Was not able to make more tests. Instead I changed the description of the kata.
If there is someone who can contribute to the unit tests that would be great!
This kata needs more test cases
Was not able to make more tests. Instead I changed the description of the kata.
If there is someone who can contribute to the unit tests that would be great!
This comment has been hidden.
Was not able to make more tests. Instead I changed the description of the kata.
If there is someone who can contribute to the unit tests that would be great!
This comment has been hidden.
Was not able to make more tests. Instead I changed the description of the kata.
If there is someone who can contribute to the unit tests that would be great!
you can easy cheat on this kata
Was not able to make more tests. Instead I changed the description of the kata.
If there is someone who can contribute to the unit tests that would be great!
A couple of issues - I think the description needs to be expanded on a little. Not to make it easier, but maybe a checklist of potential problems, like:
Remember to check things like braces, commas, and letter case
Also, I think the indentation is a little messed up in the initial code, not sure if this is intentional to make working out the problems more difficult, but if not it should be made more consistent.
Thanks for the tip. Will go ahead and change the title and description again.
If there is someone who can contribute to the unit tests that would be great!
Resolved.
you dont check that one uses the method objMethod , one can pass retrieving return "string"
As I can see it the solutions, some just returned "string" and passed! More tests should be added to prevent such solutions from passing!
Please see previous comments.
This kata is tagged with
However, I think that they're not really correct. The "code" we have to fix is over-engineered, and the sign of someone who's too excited about language features. The code can be solved without OOP, there's no actual (conditional) control flow, the kata doesn't focus on functions, and depending on your language, "method" and "function" are simply aliases.
I propose the following tags instead:
I can only see
right now. Maybe this is already resolved?
That are the major tags. Have a look at the detail page for the rest of them.
Oh, those. I never know who sets them. In my own kata they tend to appear by themselves somehow. Could be a similar case here. Bug?
I looked in the editor, the only tags that are entered there are 'bugs, methods'. This is a CodeWars bug, not a kata issue.
Do you want to file an issue on github? Or should I?
You file it, I'm posting too often there recently :)
Sure? I haven't posted many recently, but I'm still ahead ;). Just posted issue #119.
Can someone help me improve the test case so that warriors cannot solve this by simply entering return "string".
This comment has been hidden.
This kata is meant to be easy. Analyzing error messages is actually the key to solve katas of this type. How is this a kata issue? Can you please mark this issue as resolved?
Alright as you wish.
IMHO - There's no decent description to this kata
Example Test Case is not formatted properly. It must have "string" as the second argument.
Looks like this was resolved.
I don't think this kata needs much more to be ready; it's kind of fun to see how many problems can be made in one place. Maybe a count of the total number of problems with the kata would be nice although working through it iteratively isn't the end of the world.
Some example test code or some tip in the description about what the function expects may help, as I blindly tried a bit before going for the most obvious way, thinking there was some further trick to figure out.