Skip to content

Fix unit tests for Leap exercise - #446

Merged
tejasbubane merged 1 commit into
exercism:masterfrom
xarxziux:leap-436
Sep 2, 2018
Merged

tejasbubane merged 1 commit into
exercism:masterfrom
xarxziux:leap-436

Conversation

@xarxziux

Copy link
Copy Markdown
Contributor

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:

  • 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.

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.
@PurpleCatfish

Copy link
Copy Markdown

this change may broke other people solution that are already submitted.
thank you for your contribution, lets wait for mainteners.

@xarxziux

Copy link
Copy Markdown
Contributor Author

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.

@xarxziux

Copy link
Copy Markdown
Contributor Author

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.

@tejasbubane
tejasbubane merged commit 74bec08 into exercism:master Sep 2, 2018
@xarxziux
xarxziux deleted the leap-436 branch September 2, 2018 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants