(FEL): redux use const for action types doesn't accept a valid answer
See original GitHub issueDescribe the Issue
As pointed out by @raditotev in the affected page, there is a valid solution, that isn’t accepted by the tests. But if we keep adding to the regex, it will be too complicated, and it will get out of hand for new contributor to be able to help.
Radi comment: https://github.com/freeCodeCamp/freeCodeCamp/pull/46753#issuecomment-1174857836
@lulululu12345 has mentioned a regex solution in his comment, but I am hoping there is an alternative to regex
Luke comment: https://github.com/freeCodeCamp/freeCodeCamp/pull/46753#issuecomment-1175136663
Here is the markdown page https://github.com/freeCodeCamp/freeCodeCamp/blob/04eaee51fc08b27576081519306819d467e62793/curriculum/challenges/english/03-front-end-development-libraries/redux/use-const-for-action-types.md
Affected Page
https://www.freecodecamp.org/learn/front-end-development-libraries/redux/use-const-for-action-types
Your code
const {LOGIN, LOGOUT} = {LOGIN: 'LOGIN', LOGOUT: 'LOGOUT'}
Expected behavior
This code is valid, so we should allow it to pass. But as mentioned before the regex is too complex, I wonder if we can do something that make the need for using regex unnecessary.
Screenshots

Issue Analytics
- State:
- Created a year ago
- Comments:13 (13 by maintainers)

Top Related StackOverflow Question
there is a function to strip comments that can be used, so that the last two can be included
There are two conditions to be fulfilled for this test:
Consider this:
I think the above will work without being too implicit regarding the solution. I would say the last two
assert.isNotOkcould even be omitted because there is always a slim chance someone might write unconsciously some comment that might containletorvaras substrings.