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): Remove additional unnecessary assert message argument from English challenges JavaScript Algorithms and Data Structures #36439

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.

Related to issue #36400

This PR removes assert message arguments from testString for the following sub sections of the JavaScript Algorithms and Data Structures curriculum section. This PR was created to remove assert message arguments which were wrapped in two single quotes instead of single quotes. See this discussion for more information

  • Basic Algorithm Scripting
  • Debugging
  • ES6
  • Functional Programming
  • Basic Data Structures
  • Intermediate Algorithm Scripting
  • Object Oriented Programming
  • Regular Expressions
  • JavaScript Algorithms and Data Structures Projects

@RandellDawson RandellDawson force-pushed the fix/remove-unnecessary-assert-mesage-argument-from-various-javascript-algorithms-and-data-structures-challenges branch from e7ac1a5 to d07d240 Compare July 10, 2019 21:51
@camperbot camperbot added language: English scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. labels Jul 10, 2019
@RandellDawson RandellDawson force-pushed the fix/remove-unnecessary-assert-mesage-argument-from-various-javascript-algorithms-and-data-structures-challenges branch from d07d240 to fcde0cd Compare July 12, 2019 18:04
@raisedadead raisedadead added release: next/beta type: showstopper Issues that are urgent and are critical path. These need immediate attention & shipping. labels Jul 23, 2019
Copy link
Member

@vkWeb vkWeb left a comment

Choose a reason for hiding this comment

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

@RandellDawson Except for a few files, all the files have message arguments that need to be removed. Please go through all the files once more.

@@ -31,7 +31,7 @@ tests:
- text: <code>booWho([].slice)</code> should return false.
testString: assert.strictEqual(booWho([].slice), false, '<code>booWho([].slice)</code> should return false.');
Copy link
Member

Choose a reason for hiding this comment

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

Fix this file.

- text: 'The <code>foods</code> object should have only the following key-value pairs: <code>apples: 25</code>, <code>oranges: 32</code>, <code>plums: 28</code>, <code>bananas: 13</code>, <code>grapes: 35</code>, <code>strawberries: 27</code>'
testString: 'assert.deepEqual(foods, {apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27}, ''The <code>foods</code> object should have only the following key-value pairs: <code>apples: 25</code>, <code>oranges: 32</code>, <code>plums: 28</code>, <code>bananas: 13</code>, <code>grapes: 35</code>, <code>strawberries: 27</code>'');'
testString: 'assert.deepEqual(foods, {apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27});'
- text: <code>checkInventory("apples")</code> should return <code>25</code>
testString: assert.strictEqual(checkInventory('apples'), 25, '<code>checkInventory("apples")</code> should return <code>25</code>');
Copy link
Member

Choose a reason for hiding this comment

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

3 arguments in this file.

@@ -22,7 +22,7 @@ tests:
- text: The <code>user</code> object has <code>name</code>, <code>age</code>, and <code>data</code> keys
testString: assert('name' in user && 'age' in user && 'data' in user, 'The <code>user</code> object has <code>name</code>, <code>age</code>, and <code>data</code> keys');
Copy link
Member

Choose a reason for hiding this comment

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

2 arguments in this file.

@@ -43,7 +43,7 @@ tests:
- text: The <code>online</code> property nested in the <code>data</code> key of <code>userActivity</code> should be set to <code>45</code>
testString: assert(userActivity.data.online === 45, 'The <code>online</code> property nested in the <code>data</code> key of <code>userActivity</code> should be set to <code>45</code>');
Copy link
Member

Choose a reason for hiding this comment

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

3 arguments in this file.

@@ -27,7 +27,7 @@ Use the delete keyword to remove the <code>oranges</code>, <code>plums</code>, a
```yml
tests:
- text: 'The <code>foods</code> object only has three keys: <code>apples</code>, <code>grapes</code>, and <code>bananas</code>'
testString: 'assert(!foods.hasOwnProperty(''oranges'') && !foods.hasOwnProperty(''plums'') && !foods.hasOwnProperty(''strawberries'') && Object.keys(foods).length === 3, ''The <code>foods</code> object only has three keys: <code>apples</code>, <code>grapes</code>, and <code>bananas</code>'');'
testString: 'assert(!foods.hasOwnProperty(''oranges'') && !foods.hasOwnProperty(''plums'') && !foods.hasOwnProperty(''strawberries'') && Object.keys(foods).length === 3);'
- text: The <code>oranges</code>, <code>plums</code>, and <code>strawberries</code> keys are removed using <code>delete</code>
testString: assert(code.search(/oranges:/) !== -1 && code.search(/plums:/) !== -1 && code.search(/strawberries:/) !== -1, 'The <code>oranges</code>, <code>plums</code>, and <code>strawberries</code> keys are removed using <code>delete</code>');
Copy link
Member

Choose a reason for hiding this comment

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

This one here.

@@ -52,7 +52,7 @@ tests:
- text: <code>Dog</code> should receive an argument for <code>name</code>.
testString: assert((new Dog('Clifford')).name === 'Clifford', '<code>Dog</code> should receive an argument for <code>name</code>.');
Copy link
Member

Choose a reason for hiding this comment

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

3 arguments.

@@ -35,7 +35,7 @@ tests:
- text: Your regex should find 12 non-digits in <code>"21 Jump Street"</code>.
testString: assert("21 Jump Street".match(noNumRegex).length == 12, 'Your regex should find 12 non-digits in <code>"21 Jump Street"</code>.');
Copy link
Member

Choose a reason for hiding this comment

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

A lot of arguments found.

@@ -35,7 +35,7 @@ tests:
- text: Your regex should find 2 digits in <code>"21 Jump Street"</code>.
testString: assert("21 Jump Street".match(numRegex).length == 2, 'Your regex should find 2 digits in <code>"21 Jump Street"</code>.');
Copy link
Member

Choose a reason for hiding this comment

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

A lot of arguments here too.

@@ -34,7 +34,7 @@ tests:
- text: Your regex should find 35 non-spaces in <code>"Men are from Mars and women are from Venus."</code>
testString: assert("Men are from Mars and women are from Venus.".match(countNonWhiteSpace).length == 35, 'Your regex should find 35 non-spaces in <code>"Men are from Mars and women are from Venus."</code>');
- text: 'Your regex should find 23 non-spaces in <code>"Space: the final frontier."</code>'
testString: 'assert("Space: the final frontier.".match(countNonWhiteSpace).length == 23, ''Your regex should find 23 non-spaces in <code>"Space: the final frontier."</code>'');'
testString: 'assert("Space: the final frontier.".match(countNonWhiteSpace).length == 23);'
- text: Your regex should find 21 non-spaces in <code>"MindYourPersonalSpace"</code>
testString: assert("MindYourPersonalSpace".match(countNonWhiteSpace).length == 21, 'Your regex should find 21 non-spaces in <code>"MindYourPersonalSpace"</code>');
Copy link
Member

Choose a reason for hiding this comment

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

4 arguments.

@@ -35,7 +35,7 @@ tests:
- text: Your regex should find eight spaces in <code>"Men are from Mars and women are from Venus."</code>
testString: assert("Men are from Mars and women are from Venus.".match(countWhiteSpace).length == 8, 'Your regex should find eight spaces in <code>"Men are from Mars and women are from Venus."</code>');
- text: 'Your regex should find three spaces in <code>"Space: the final frontier."</code>'
testString: 'assert("Space: the final frontier.".match(countWhiteSpace).length == 3, ''Your regex should find three spaces in <code>"Space: the final frontier."</code>'');'
testString: 'assert("Space: the final frontier.".match(countWhiteSpace).length == 3);'
- text: Your regex should find no spaces in <code>"MindYourPersonalSpace"</code>
testString: assert("MindYourPersonalSpace".match(countWhiteSpace) == null, 'Your regex should find no spaces in <code>"MindYourPersonalSpace"</code>');
Copy link
Member

Choose a reason for hiding this comment

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

4 arguments.

@RandellDawson
Copy link
Member Author

RandellDawson commented Jul 25, 2019

@vkWeb This PR actually is an extra PR which removed arguments which were missed in the series of other PRs for the JavaScript Algorithm and Data Structures section. This PR only will contain fixes which were missed in the earlier PRs.

Note to Mods: For any mods reviewing any PR in this series where the title starts with "Remove additional ...", you will encounter what @vkWeb has described here. You just will have to trust the earlier PRs removed the other lines. Remember, if an argument is left in, it is not an actual issue. This series of PRs was just meant to remove 99% of the unnecessary assert message arguments.

We can wait to merge this one after all the others have been merged and then I will rebase this one against master and then we can see if any changes are still necessary. I will temporarily add the blocked label until the others have been merged.

@RandellDawson RandellDawson added the status: blocked Is waiting on followup from either the Opening Poster of the issue or PR, or a maintainer. label Jul 25, 2019
@vkWeb
Copy link
Member

vkWeb commented Jul 25, 2019

@RandellDawson Ohh. Okay, I'll give this one a quick look after rebase.

@thecodingaviator
Copy link
Contributor

This is the only such PR left now @RandellDawson

@RandellDawson RandellDawson force-pushed the fix/remove-unnecessary-assert-mesage-argument-from-various-javascript-algorithms-and-data-structures-challenges branch from fcde0cd to e88e795 Compare July 27, 2019 23:37
@RandellDawson RandellDawson removed the status: blocked Is waiting on followup from either the Opening Poster of the issue or PR, or a maintainer. label Jul 27, 2019
@RandellDawson RandellDawson force-pushed the fix/remove-unnecessary-assert-mesage-argument-from-various-javascript-algorithms-and-data-structures-challenges branch from 07a9a97 to a85a540 Compare July 28, 2019 03:37
Copy link
Contributor

@thecodingaviator thecodingaviator left a comment

Choose a reason for hiding this comment

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

LGTM

@thecodingaviator thecodingaviator merged commit ba6ae71 into freeCodeCamp:master Jul 28, 2019
@thecodingaviator
Copy link
Contributor

Thank you for your contribution to the page! 👍
We're happy to accept these changes, and look forward to future contributions. 📝

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. type: showstopper Issues that are urgent and are critical path. These need immediate attention & shipping.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants