-
-
Notifications
You must be signed in to change notification settings - Fork 36k
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
fix(curriculum): Remove additional unnecessary assert message argument from English challenges JavaScript Algorithms and Data Structures #36439
Conversation
e7ac1a5
to
d07d240
Compare
d07d240
to
fcde0cd
Compare
There was a problem hiding this 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.'); |
There was a problem hiding this comment.
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>'); |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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>'); |
There was a problem hiding this comment.
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>'); |
There was a problem hiding this comment.
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>.'); |
There was a problem hiding this comment.
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>.'); |
There was a problem hiding this comment.
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>.'); |
There was a problem hiding this comment.
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>'); |
There was a problem hiding this comment.
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>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 arguments.
@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 |
@RandellDawson Ohh. Okay, I'll give this one a quick look after rebase. |
This is the only such PR left now @RandellDawson |
fcde0cd
to
e88e795
Compare
07a9a97
to
a85a540
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for your contribution to the page! 👍 |
Update index.md
)master
branch of freeCodeCamp.Related to issue #36400
This PR removes assert message arguments from
testString
for the following sub sections of theJavaScript 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