jiebi/CodeConvo huggingface dataset:
Change:
function insertionSort(array) { for(let i=1; i; i++){ let toInsert = array[i]; let j = i-1; while(j = 0){ if(toInsert &lt; array[j]){ array[j+1] = array[j]; } else{ array[j+1] = toInsert; break; } j-- } (array) } return array; } insertionSort([5, 4, 33, 2, 8]); Will make the challenge pass even though the code is not correct which my example shows. The test in the challenge passes, because by chance the first element in the test array is also the smallest and doesnt have to be changed. So adding a second test array with a first element not being the smallest element would solve that issue. Browser: Chrome
I am able to confirm this bug.
Would either of you like to add the necessary test?
I will defer to for the opportunity to make a contribution. If they do not want to make this change, then I can go ahead and do so.

Discussion:
); ``` <ins> `insertionSort([5, 4, 33, 2, 8])` should return `[2, 4, 5, 8, 33]`. ```js assert.deepEqual(insertionSort([5, 4, 33, 2, 8]), [2, 4, 5, 8, 33]) ``` </ins> `insertionSort` should not use the built-in `.sort()` method. ```js
Change:
Describe your problem and how to reproduce it: The challenge says: It should be “HTTP request”, not “HTML request”. Also I don’t get the point in the third sentence “Since HTML is text-based, even if you don’t see the data, it doesn’t mean that it is secret”. What does HTML being text-based have to do with not seeing the data from a POST request? The response to an HTTP request doesn’t even necessarily have to be HTML, or even text-based. None of the examples up to this point has the response been HTML, but JSON. And how does HTML being text-based and not being able to see the data being sent in the request relate to the data being “secret” and why is that important? Add a Link to the page with the problem:
Agreed, thanks for pointing that out. And, yes, the third sentence is misleading. The paragraph in question is I think what the challenge should say is the following: Basically it's a warning that POSTs may look more secure, but you still need encryption!
Hello! This is my first time contributing in the code. I would like to take up this issue if no one is working on it. Thank You!
Welcome No one else seems to have taken this up yet, so please do.

Discussion:
## Description <section id='description'> Besides GET, there is another common HTTP verb, it is POST. POST is the default method used to send client data with HTML forms. In REST convention, POST is used to send data to create new items in the database (a new user, or a new blog post). You don’t have a database in this project, but you are going to learn how to handle POST requests anyway. <del> In these kind of requests, the data doesn’t appear in the URL, it is hidden in the request body. This is a part of the HTML request, also called payload. Since HTML is text-based, even if you don’t see the data, it doesn’t mean that it is secret. The raw content of an HTTP POST request is shown below: </del> <ins> In these kind of requests, the data doesn’t appear in the URL, it is hidden in the request body. The body is a part of the HTTP request, also called the payload. Even though the data is not visible in the URL, this does not mean that it is private. To see why, look at the raw content of an HTTP POST request: </ins> ```http POST /path/subpath HTTP/1.0
Change:
Describe your problem and how to reproduce it: During a challenge, testing various methods of completing them, I’ve noticed one of the coding questions seems to be a little too easy to pass and I believe it could be fixed with a simple additional test. consider this code This code will pass all the tests provided, even though, when the target is changed to for example “sage” it returns I think a test should be with some incorrect middle letters such as testing if each individual letter is correct. Let me know what you think or if I’m being silly! Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Google Chrome Browser Version: Version 84.0.4147.89 (Official Build) (64-bit) Operating System: Windows 10 Pro
I concur you have found an edge case missed by the current tests. Go ahead and create a PR.
Will do. This is exciting!

Discussion:
testString: assert(confirmEnding("He has to give me a new name", "name") === true); - text: <code>confirmEnding("Open sesame", "same")</code> should return true. testString: assert(confirmEnding("Open sesame", "same") === true); <del> - text: <code>confirmEnding("Open sesame", "pen")</code> should return false. testString: assert(confirmEnding("Open sesame", "pen") === false); </del> <ins> - text: <code>confirmEnding("Open sesame", "sage")</code> should return false. testString: assert(confirmEnding("Open sesame", "sage") === false); </ins> - text: <code>confirmEnding("Open sesame", "game")</code> should return false. testString: assert(confirmEnding("Open sesame", "game") === false); - text: <code>confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain")</code> should return false.
Change:
Describe your problem and how to reproduce it: The following code does not pass, because the test has a variable name which is the same: Solution: Change variable name of from: to To make it less likely someone uses the same variable name.
Hey! I am a beginner in open source programming. Can I take this issue up? Thanks.
, Yes you may have a go at this. To begin, you should go through the , if you have not already. Some things to highlight: We do not typically assign issues If an issue has help wanted or first timers only labels, then they are open for contribution The first PR which closes the issue will be accepted If you have any questions about contributing in general, or setting up fCC locally, the , and the are excellent places to start.

Discussion:
- text: Your <code>incrementer</code> function should take an argument. testString: assert(incrementer.length === 1); - text: Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value. <del> testString: const newValue = incrementer(fixedValue); assert(newValue === 5); </del> <ins> testString: const __newValue = incrementer(fixedValue); assert(__newValue === 5); </ins> ```
Change:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: The tests appear to require specific (albeit conventionally correct) formatting in order for the code to pass. This code block, provided by a user, did not pass: However, if I ran the formatter with ++, the resulting formatted code did pass: Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Chrome Browser Version: 85.0.4183.83 Operating System: Windows 10 v1909
Confirmed. This is due to the extra space between the word else and if. Here is the culprit: Changing the above to this should work: Open up to first-timers?
Sounds good to me!
Hi, I would like to pick this! Thanks for the guide! :)
Welcome! Issues labelled don't require permission for a pull request, as long as its your first pull request with us. If you have not done so already, please give our a read - there are a lot of helpful tips in there to get you started.
Hi, i am a first timer. Is the issue still open?
Hey We typically accept PRs in the order we receive them, so this will be open until we get a working PR.

Discussion:
- text: You should have at least two <code>if</code> statements testString: assert(code.match(/if/g).length > 1); - text: You should have closing and opening curly braces for each <code>if else</code> code block. <del> testString: assert(code.match(/ifs*((.+))s*{[sS]+}s*else ifs*((.+))s*{[sS]+}s*elses*{[sS]+s*}/)); </del> <ins> testString: assert(code.match(/ifs*((.+))s*{[sS]+}s*elses+ifs*((.+))s*{[sS]+}s*elses*{[sS]+s*}/)); </ins> - text: <code>testElseIf(0)</code> should return "Smaller than 5" testString: assert(testElseIf(0) === "Smaller than 5"); - text: <code>testElseIf(5)</code> should return "Between 5 and 10"
Change:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: While helping a camper with their work on this solution, I took a look at mine and discovered it passes when it should not. If you paste this code into the editor, you can see that has been modified from to but the test does not catch this fact. I believe it may be due to the tests for array modification calling the function without an parameter: If I assign a default value of in the function, then the tests catch this behaviour as expected. As such, I believe updating these function calls in the tests should correct this error. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Chrome Browser Version: 85.0.4183.102 Operating System: Windows 10 v 1909 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): !
I believe so. Essentially if you invoke without , the value of is and from the solution you have given, will be which is . Therefore : As a result and remain unmutated. What i am not sure of is whether invoking the function without was an oversight or intentional.
calling the function without an stops various loop solutions from being accepted. I do not know if it was intentional
Is it to force learners to use / since it is a splice-slice challenge?
There is no requirement to use splice or slice. It is an algorithm challenge. We do not care how they solve the problem.
So, to be clear - you are thinking to put a value in for on those two tests you shared would catch this.
Yes, updating the test call to: should correct this bug

Discussion:
- text: All elements from the first array should be added to the second array in their original order. testString: assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4]); - text: The first array should remain the same after the function runs. <del> testString: frankenSplice(testArr1, testArr2); assert.deepEqual(testArr1, [1, 2]); </del> <ins> testString: frankenSplice(testArr1, testArr2, 1); assert.deepEqual(testArr1, [1, 2]); </ins> - text: The second array should remain the same after the function runs. <del> testString: frankenSplice(testArr1, testArr2); assert.deepEqual(testArr2, ["a", "b"]); </del> <ins> testString: frankenSplice(testArr1, testArr2, 1); assert.deepEqual(testArr2, ["a", "b"]); </ins> ```
Change:
After some discussion on the forum, it was concluded the following challenges need the removed from the the frontmatter of the challenge files.
I am first timer to contribute it. please help with it. We need to remove the from right.
Yes and the same goes for the other challenge too.
Thank you for your contribution. For future reference, you can make changes to multiple files on the same. Also, you really should make your changes on a different branch than to avoid soiling it. I suggest taking a look at our documentation on when you want to work on more complex PRs.

Discussion:
id: bad87fee1348bd9aede08830 title: Create a Form Element challengeType: 0 <del> videoUrl: 'https://scrimba.com/p/pVMPUv/cmQ3Kfa' </del> forumTopicId: 16817 ---
Change:
After some discussion on the forum, it was concluded the following challenges need the removed from the the frontmatter of the challenge files.
I am first timer to contribute it. please help with it. We need to remove the from right.
Yes and the same goes for the other challenge too.
Thank you for your contribution. For future reference, you can make changes to multiple files on the same. Also, you really should make your changes on a different branch than to avoid soiling it. I suggest taking a look at our documentation on when you want to work on more complex PRs.

Discussion:
id: 587d78a4367417b2b2512ad2 title: Learn about Tertiary Colors challengeType: 0 <del> videoUrl: 'https://scrimba.com/c/c3bRDAb' </del> forumTopicId: 301057 ---
Change:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: In the challenge that I mentioned in the title there is an issue. Even when the output doesn't match with the challenge requirements but it still passes the challenge. I have linked some gifs so it is more understandable. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Google Chrome Browser Version: 85.0.4183.121 Operating System: Windows 10 64-bit If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): The output doesn't match with the requirements but it still passes the challenge: While this is the correct code and output: This also passes the challenge:
Good catch! The first test on this page uses: A fun quirk with that I ran in to yesterday is that it returns true on an empty array. This error could likely be fixed by adding an assertion for .
Honestly I didn't know why it passed the challenge. Thank you for the explanation.
Opening this up for contributions. As mentions, we just need an additional condition in the to test that is non-zero (which means it would be truthy).
you can find in stackovervlow

Discussion:
```yml tests: - text: <code>arr2</code> should be correct copy of <code>arr1</code>. <del> testString: assert(arr2.every((v, i) => v === arr1[i])); </del> <ins> testString: assert(arr2.every((v, i) => v === arr1[i]) && arr2.length); </ins> - text: <code>...</code> spread operator should be used to duplicate <code>arr1</code>. testString: assert(code.match(/Array(s*...arr1s*)|[s*...arr1s*]/)); - text: <code>arr2</code> should remain unchanged when <code>arr1</code> is changed.
Change:
The tests need to be updated to allow for the two main ways of defining routes: AND Add a Link to the page with the problem:
We need to figure how to test most things without using regex.
We could change the tests to ping the route, to determine if it was defined correctly?

Discussion:
# --hints-- <del> Route /auth/github should be correct. </del> <ins> Route `/auth/github` should be correct. </ins> ```js <del> (getUserInput) => $.get(getUserInput('url') + '/_api/routes.js').then( (data) => { </del> <ins> async (getUserInput) => { try { const res = await fetch(getUserInput('url') + '/_api/routes.js'); if (res.ok) { const data = await res.text(); </ins> assert.match( <del> data.replace(/s/g, ''), /('|")/auth/github/?1[^]*?get.*?passport.authenticate.*?github/gi, 'Route auth/github should only call passport.authenticate with github' ); }, (xhr) => { throw new Error(xhr.statusText); </del> <ins> data.replace(/s/g, ''), /passport.authenticate.*?github/g, 'Route auth/github should only call passport.authenticate with github' ); } else { throw new Error(res.statusText); </ins> } <del> ); </del> <ins> const res2 = await fetch(getUserInput('url') + '/_api/app-stack'); if (res2.ok) { const data2 = JSON.parse(await res2.json()); const dataLayer = data2.find(layer => layer?.route?.path === '/auth/github'); assert.deepInclude(dataLayer?.route, { methods: {get: true}, path: "/auth/github"}); assert.deepInclude(dataLayer?.route?.stack?.[0], {method: "get", name: "authenticate"}); } else { throw new Error(res2.statusText); } } catch (err) { throw new Error(err); } } </ins> ``` <del> Route /auth/github/callback should be correct. </del> <ins> Route `/auth/github/callback` should be correct. </ins> ```js <del> (getUserInput) => $.get(getUserInput('url') + '/_api/routes.js').then( (data) => { </del> <ins> async (getUserInput) => { try { const res = await fetch(getUserInput('url') + '/_api/routes.js'); if (res.ok) { const data = await res.text(); </ins> assert.match( data.replace(/s/g, ''), <del> /('|")/auth/github/callback/?1[^]*?get.*?passport.authenticate.*?github.*?failureRedirect:("|')/2/gi, </del> <ins> /failureRedirect:("|')/1/g, </ins> 'Route auth/github/callback should accept a get request and call passport.authenticate for github with a failure redirect to home' ); <del> }, (xhr) => { throw new Error(xhr.statusText); </del> <ins> } else { throw new Error(res.statusText); } const res2 = await fetch(getUserInput('url') + '/_api/app-stack'); if (res2.ok) { const data2 = JSON.parse(await res2.json()); const dataLayer = data2.find(layer => layer?.route?.path === '/auth/github/callback'); assert.deepInclude(dataLayer?.route, { methods: {get: true}, path: "/auth/github/callback"}); assert.deepInclude(dataLayer?.route?.stack?.[0], {method: "get", name: "authenticate"}); } else { throw new Error(res2.statusText); </ins> } <del> ); </del> <ins> } catch (err) { throw new Error(err); } } </ins> ``` # --solutions--
Change:
!
Dropping Firefox support temporarily with . This was causing me to slow down with the PRs and rapid testing we are doing on the staging. I will let someone else investigate this.
any thoughts on this one? I'll take a look when I can, but I figured you might have some insight.
I'll look into it soon. Will let you know when I get to the bottom of it.
Mrugesh shared two links to the CI runs that failed and both of them failed for the . So, I was looking at the test and saw a lot of explicit timeout increasing... this is probably the reason why it fails on Firefox. Because the timeout were increased by watching the time it took on Chrome and manually adjusting it. But Firefox normally needs a few more seconds to finish running (this is due to ). I think increasing the timeout limit should do the trick.
We do wait for the editor, but everything after that should be basically instantaneous. Thanks for investigating that, but it should be fixed for Firefox 80 () and that's what we run the tests on. Also, suggests we should be using which could be a factor, but would have thought that would make things fail entirely rather than run slowly. That could work, yeah. The strange thing is the dev mode works perfectly locally and the CI should be even faster, since it uses the built site.
The bug is fixed on Firefox but Cypress still manually triggers GC as it is said in the Cypress docs (also when you run the tests locally in Firefox, it'll show you a message about GC. This is because Cypress doesn't manually run GC on but when it's run in CI using then Cypress manually triggers GC). I agree. I don't think this is the reason. I couldn't reproduce the bug locally... maybe we should try to reproduce it in CI by running it repeatedly?
Right, but would this make a test fail? If it runs between tests, which is the default, it should just make the whole run a bit slower. If it's included in the timeout for a particular test, that would be a massive oversight. My assumption is that the only timeout you might hit because of this is the limit for the entire run. Sure. I'll let decide when he wants to do this, though, since it makes deploying a bit of a headache (if you're being bombarded with fail negatives, I mean).
I am open to creating a new branch on the upstream if you need to test it on CI by adding random commits? In theory you should be able to test it on a fork as well.

Discussion:
runs-on: ubuntu-18.04 strategy: matrix: <del> browsers: [chrome] </del> <ins> browsers: [chrome, firefox] </ins> services: mongodb: image: mongo:3.6.19

it('shows test output when the tests are run', () => { cy.visit(locations.index); // first wait for the editor to load <del> cy.get(selectors.editor, { timeout: 10000 }); </del> <ins> cy.get(selectors.editor, { timeout: 15000 }); </ins> cy.get(selectors.runTestsButton) .click() .then(() => {

it('shows test output when the tests are triggered by the keyboard', () => { cy.visit(locations.index); // first wait for the editor to load <del> cy.get(selectors.editor, { timeout: 10000 }); </del> <ins> cy.get(selectors.editor, { timeout: 15000 }); </ins> cy.get(selectors.hotkeys) .focus() .type('{ctrl}{enter}')
Change:
The challenge seed has since been updated, and this paragraph is out of line This should be reworded to not make a line reference. I suggest: Challenge:
I agree.
Can I have a bash at this?

Discussion:
<section id='instructions'> The code editor has two components that are partially defined for you: a parent called <code>GameOfChance</code>, and a child called <code>Results</code>. They are used to create a simple game where the user presses a button to see if they win or lose. <del> First, you'll need a simple expression that randomly returns a different value every time it is run. You can use <code>Math.random()</code>. This method returns a value between <code>0</code> (inclusive) and <code>1</code> (exclusive) each time it is called. So for 50/50 odds, use <code>Math.random() >= .5</code> in your expression. Statistically speaking, this expression will return <code>true</code> 50% of the time, and <code>false</code> the other 50%. On line 30, replace the comment with this expression to complete the variable declaration. </del> <ins> First, you'll need a simple expression that randomly returns a different value every time it is run. You can use <code>Math.random()</code>. This method returns a value between <code>0</code> (inclusive) and <code>1</code> (exclusive) each time it is called. So for 50/50 odds, use <code>Math.random() >= .5</code> in your expression. Statistically speaking, this expression will return <code>true</code> 50% of the time, and <code>false</code> the other 50%. In the render method, replace <code>null</code> with the above expression to complete the variable declaration. </ins> Now you have an expression that you can use to make a randomized decision in the code. Next you need to implement this. Render the <code>Results</code> component as a child of <code>GameOfChance</code>, and pass in <code>expression</code> as a prop called <code>fiftyFifty</code>. In the <code>Results</code> component, write a ternary expression to render the <code>h1</code> element with the text <code>"You Win!"</code> or <code>"You Lose!"</code> based on the <code>fiftyFifty</code> prop that's being passed in from <code>GameOfChance</code>. Finally, make sure the <code>handleClick()</code> method is correctly counting each turn so the user knows how many times they've played. This also serves to let the user know the component has actually updated in case they win or lose twice in a row. </section>
Change:
Under Tests section text and textString do not match properly. If you only forget ' ; ' it still awaits for ' % ' We need a separate test for ' ; ' check or fix the text like ' Do not forget % or ; '
The can be made optional in the regex instead. Leaving the off the end of the line does not affect the code. The test is trying to get the user to implement a "best practice", but all we really care about is the code written is valid and accomplishes the task. Are you interested in creating a PR to make the at he end of the line optional?
While we are at it, can we strip the code of whitespace? I much prefer looking at regex without the everywhere.
I think that is fine. FYI - There are a few helper functions available that can be used in the testString by using . For example, you could use it in the referenced in this issue like:

Discussion:
- text: The value of <code>remainder</code> should be <code>2</code> testString: assert(remainder === 2); - text: You should use the <code>%</code> operator <del> testString: assert(/s+?remainders*?=s*?.*%.*;/.test(code)); </del> <ins> testString: assert(/s+?remainders*?=s*?.*%.*;?/.test(code)); </ins> ```