fix(curriculum): add regex for comma separated const declarations (#42518)

Co-authored-by: Pat Lehmann <patrick.lehmann@homes.com>
This commit is contained in:
Patrick Lehmann
2021-06-17 08:35:46 -04:00
committed by GitHub
parent aa21539967
commit bc42ad1f27

View File

@ -88,8 +88,9 @@ The `authReducer` function should handle multiple action types with a switch sta
```js
const noWhiteSpace = __helpers.removeWhiteSpace(code);
assert(
/constLOGIN=(['"`])LOGIN\1/.test(noWhiteSpace) &&
/constLOGOUT=(['"`])LOGOUT\1/.test(noWhiteSpace)
(/constLOGIN=(['"`])LOGIN\1/.test(noWhiteSpace) &&
/constLOGOUT=(['"`])LOGOUT\1/.test(noWhiteSpace)) ||
/const(LOGIN|LOGOUT)=(['"`])\1\2,(?!\1)(LOGIN|LOGOUT)=(['"`])\3\4/.test(noWhiteSpace)
);
```