diff --git a/common/app/routes/Challenges/utils/index.js b/common/app/routes/Challenges/utils/index.js index abbe766115..516fb47701 100644 --- a/common/app/routes/Challenges/utils/index.js +++ b/common/app/routes/Challenges/utils/index.js @@ -118,7 +118,8 @@ export function createTests({ tests = [] }) { .map(test => { if (typeof test === 'string') { return { - text: ('' + test).split('message: ').pop().replace(/\'\);/g, ''), + text: ('' + test).split('message: ') + .pop().replace(/(\'\);(\s*\};)?)/g, ''), testString: test }; }