Repository navigation
Fix unit tests for Leap exercise - #446
Conversation
Change the unit tests for the Leap exercise to accept a named function import instead of a default named import as per issues exercism#274 and exercism#436: - Change default import `Year` to named import `{ isLeap }`. - Remove unnecessary `const year = new Year(...` calls. - Change `year.isLeap()` calls to `isLeap(XXXX)`. - Rewrite example.js file to export a single named function.
|
this change may broke other people solution that are already submitted. |
|
This may be true, but I believe the impact will be fairly minimal. Currently I see only ten unapproved submissions for Leap on the mentor dashboard which is quite manageable. |
|
I'd like to reiterate my case for this PR by referring to my experiences as a mentor on the JavaScript track. I've seen quite a few submissions come in from beginner developers who were capable of solving the problem, but struggled with constructing the problem in the way that the current unit tests demand. I know that beginner developers are not really Exercism's target audience, but I see them coming through anyway on the JS track. There are many languages where this exercise is a one-liner, and others, particularly OOP languages, where there's quite a bit more work involved. JavaScript is quite capable of being one of the one-liner languages so forcing students to frame their answer in an OOP style makes this exercise artificially more complicated than it needs to be. As the first mentored exercise on the track, I really think we should try to keep this one as simple as possible. |
Change the unit tests for the Leap exercise to accept a named function import instead of a default named import as per issues #274 and #436:
Yearto named import{ isLeap }.const year = new Year(...calls.year.isLeap()calls toisLeap(XXXX).