Closed joshalling closed 6 years ago
is there any FCC documentation related to creating tests?
Check both the documents in this folder https://github.com/freeCodeCamp/curriculum/tree/dev/docs
:tada: This issue has been resolved in version 3.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I have noticed that a number of the challenges do not have any solutions that are being tested, namely the Responsive Web Design challenges. This became apparent to me recently when I had submitted a pull request that passed all the tests, but had a typo in it that would have broken the updated challenge. Luckily @scissorsneedfoodtoo caught it and the bug was avoided. (#167)
I understand that in many cases it is not possible to test solutions because the assertions rely on elements in the DOM, but there are some tests that only match your code to a regex expression, and these could be tested as in the example below
Test:
"assert(code.match(/background:\\s*?linear-gradient\\(35deg,\\s*?(#CCFFFF|#CFF),\\s*?(#FFCCCC|#FCC)\\);/gi), 'The <code>div</code> element should have a <code>linear-gradient</code> <code>background</code> with the specified direction and colors.');"
Solution:
"var code = \"<style> div{border-radius: 20px; width: 70%; height: 400px; margin: 50px auto; background: linear-gradient(35deg, #cff, #fcc);}</style><div></div>\""
I would love to work on adding these solutions that are possible, and I will get started on it. Are there any plans to make the assertions that rely on the DOM testable? Because it would be ideal to have every challenge tested to minimize the chances for human error.