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

fix(curriculum): Improved the tests for Find the length of a String challenge #35940

Conversation

RandellDawson
Copy link
Member

  • I have read freeCodeCamp's contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the master branch of freeCodeCamp.
  • None of my changes are plagiarized from another source without proper attribution.
  • All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
  • My changes do not use shortened URLs or affiliate links.

I have noticed a few campers get confused regarding the test messages for this challenge. The reason for the confusion is if the user changes the original setup code, but the code would still technically result in the correct solution, the test message would fail but the reason given would not match the reason stated because the test combines the following checks but displays "You should be getting the length of lastName by using .length like this: lastName.length." if either fail.

  1. Check that the original setup code is not changed
  2. Check the the user gets the length of lastName by using .length like this: lastName.length

See https://www.freecodecamp.org/forum/t/help-w-js-challenge-suspected-bug/274365 for the full discussion.

This PR creates an additional test to make sure the user does not change the original setup code which the tests use.

@RandellDawson RandellDawson added scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: need to test locally labels Apr 29, 2019
Copy link
Contributor

@ValeraS ValeraS left a comment

Choose a reason for hiding this comment

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

we can delete an after test section.

Co-Authored-By: RandellDawson <5313213+RandellDawson@users.noreply.github.com>
@RandellDawson
Copy link
Member Author

@ValeraS So we do not need the following for this challenge? That was already there.


### After Test
<div id='js-teardown'>
```js
if(typeof lastNameLength !== "undefined"){(function(){return lastNameLength;})();}
```
</div>

@ValeraS
Copy link
Contributor

ValeraS commented Apr 29, 2019

I don't see why it's needed.

Copy link
Member

@moT01 moT01 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @RandellDawson! There was no issue for this I take it?

@moT01 moT01 merged commit 66398a9 into freeCodeCamp:master May 1, 2019
@RandellDawson RandellDawson deleted the fix/add-test-to-validate-setup-variable-declaration-is-not-modified-by-user branch May 1, 2019 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants